From: Stephen Adams Date: Tue, 5 Sep 1995 19:14:35 +0000 (+0000) Subject: Added constant-folder for STRING->SYMBOL. X-Git-Tag: 20090517-FFI~5978 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=96a15598f83a250a0444f6fca60ac1f53517d852;p=mit-scheme.git Added constant-folder for STRING->SYMBOL. --- diff --git a/v8/src/compiler/midend/cleanup.scm b/v8/src/compiler/midend/cleanup.scm index 6221200d0..8fcb382b1 100644 --- a/v8/src/compiler/midend/cleanup.scm +++ b/v8/src/compiler/midend/cleanup.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: cleanup.scm,v 1.24 1995/08/10 19:21:58 adams Exp $ +$Id: cleanup.scm,v 1.25 1995/09/05 19:14:35 adams Exp $ Copyright (c) 1994-1995 Massachusetts Institute of Technology @@ -404,6 +404,13 @@ MIT in each case. |# (define-commutative-cleanup-rewrite fix:xor) (define-commutative-cleanup-rewrite fix:+ +) (define-commutative-cleanup-rewrite fix:* *)) + +(define-cleanup-rewrite 'STRING->SYMBOL 1 + (lambda (expr) + (let ((value (form/number? expr))) + (and (QUOTE/? expr) + (string? (quote/test expr)) + `(QUOTE ,(string->symbol (quote/text expr))))))) ;; (let ((NOT-primitive (make-primitive-procedure 'NOT)))