From ff03ebca1a3bce35a2f10c5994166eaf77d080a1 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 22 Sep 2009 06:58:30 -0700 Subject: [PATCH] Tweak EQUALITY-PREDICATE to do what it's called. --- src/runtime/structure-parser.scm | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/runtime/structure-parser.scm b/src/runtime/structure-parser.scm index 0a12c2ab8..a49d27e6f 100644 --- a/src/runtime/structure-parser.scm +++ b/src/runtime/structure-parser.scm @@ -220,7 +220,7 @@ USA. env (make-object-parser (lambda (item win lose) - `(IF ,(equality-predicate item (cadr pattern)) + `(IF (,(equality-predicate (cadr pattern)) ,item ',(cadr pattern)) (,win ,(single-val item) ,lose) (,lose)))))) @@ -229,20 +229,18 @@ USA. env (make-object-parser (lambda (item win lose) - `(IF ,(equality-predicate item (cadr pattern)) + `(IF (,(equality-predicate (cadr pattern)) ,item ',(cadr pattern)) (,win ,(null-vals) ,lose) (,lose)))))) -(define (equality-predicate item datum) - `(,(cond ((or (symbol? datum) - (char? datum) - (boolean? datum) - (null? datum)) - 'EQ?) - ((number? datum) 'EQV?) - (else 'EQUAL?)) - ,item - ',datum)) +(define (equality-predicate datum) + (cond ((or (symbol? datum) + (char? datum) + (boolean? datum) + (null? datum)) + 'EQ?) + ((number? datum) 'EQV?) + (else 'EQUAL?))) (define-context-method 'VALUES 'OBJECT (lambda (vals) -- 2.25.1