From: Stephen Adams Date: Fri, 3 Nov 1995 21:11:31 +0000 (+0000) Subject: Added type info for character convertion operations. X-Git-Tag: 20090517-FFI~5788 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a5cc4fff24ddd0c9146eaf0266f1d98316ac1504;p=mit-scheme.git Added type info for character convertion operations. --- diff --git a/v8/src/compiler/midend/typedb.scm b/v8/src/compiler/midend/typedb.scm index 9580b5fb7..3e161f80b 100644 --- a/v8/src/compiler/midend/typedb.scm +++ b/v8/src/compiler/midend/typedb.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: typedb.scm,v 1.3 1995/10/25 18:35:15 adams Exp $ +$Id: typedb.scm,v 1.4 1995/11/03 21:11:31 adams Exp $ Copyright (c) 1995 Massachusetts Institute of Technology @@ -127,6 +127,39 @@ MIT in each case. |# (primitive-procedure-type (list type:any) type:compiled-procedure 'function)) + +;;; MIT Scheme charatcers have a 7 code-bits + 5 bucky-bits encoding, +;;; hence some results are fix in bytes: + +(define-operator-type (make-primitive-procedure 'CHAR-CODE) + (primitive-procedure-type (list type:character) type:unsigned-byte + 'function)) + +(define-operator-type (make-primitive-procedure 'CHAR-BITS) + (primitive-procedure-type (list type:character) type:unsigned-byte + 'function)) + +(define-operator-type (make-primitive-procedure 'MAKE-CHAR) + (primitive-procedure-type (list type:unsigned-byte type:unsigned-byte) + type:character + 'function)) + +(define-operator-type (make-primitive-procedure 'CHAR->INTEGER) + (primitive-procedure-type (list type:character) type:small-fixnum>=0 + 'function)) + +(define-operator-type (make-primitive-procedure 'INTEGER->CHAR) + (primitive-procedure-type (list type:small-fixnum>=0) type:character + 'function)) + +(define-operator-type (make-primitive-procedure 'CHAR->ASCII) + (primitive-procedure-type (list type:character) type:unsigned-byte + 'function)) + +(define-operator-type (make-primitive-procedure 'ASCII->CHAR) + (primitive-procedure-type (list type:unsigned-byte type:character) + 'function)) + (let ()