From: Stephen Adams Date: Tue, 28 Nov 1995 17:43:59 +0000 (+0000) Subject: Added simplifier for EQ? X-Git-Tag: 20090517-FFI~5717 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=50ec2b155ff84d5dd2fcfe73e651bbcbe6e80651;p=mit-scheme.git Added simplifier for EQ? --- diff --git a/v8/src/compiler/midend/cleanup.scm b/v8/src/compiler/midend/cleanup.scm index e3de00574..f6dda0e1c 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.26 1995/09/05 19:45:32 adams Exp $ +$Id: cleanup.scm,v 1.27 1995/11/28 17:43:59 adams Exp $ Copyright (c) 1994-1995 Massachusetts Institute of Technology @@ -404,13 +404,19 @@ 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/text expr)) `(QUOTE ,(string->symbol (quote/text expr))))))) + +(define-cleanup-rewrite (make-primitive-procedure 'EQ?) 2 + (lambda (e1 e2) + (and (QUOTE/? e1) + (QUOTE/? e2) + `(QUOTE ,(eq? (quote/text e1) (quote/text e2)))))) ;; (let ((NOT-primitive (make-primitive-procedure 'NOT)))