From a5cc4fff24ddd0c9146eaf0266f1d98316ac1504 Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Fri, 3 Nov 1995 21:11:31 +0000 Subject: [PATCH] Added type info for character convertion operations. --- v8/src/compiler/midend/typedb.scm | 35 ++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) 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 () -- 2.25.1