From 96a15598f83a250a0444f6fca60ac1f53517d852 Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Tue, 5 Sep 1995 19:14:35 +0000 Subject: [PATCH] Added constant-folder for STRING->SYMBOL. --- v8/src/compiler/midend/cleanup.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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))) -- 2.25.1