((eq? arg spar-arg:close) (make-closer (%input-closing-senv input)))
((eq? arg spar-arg:ctx)
(serror-ctx (%input-form input) senv (%input-hist input)))
+ ((eq? arg spar-arg:id!=?)
+ (make-id!=? (%input-closing-senv input) senv (%input-form input)))
((eq? arg spar-arg:id=?)
- (make-comparer (%input-closing-senv input) senv (%input-form input)))
+ (make-id=? (%input-closing-senv input) senv (%input-form input)))
((eq? arg spar-arg:senv) senv)
((eq? arg spar-arg:value) (%output-top output))
((eq? arg spar-arg:values) (%output-all output))
(lambda (expr)
(close-syntax expr closing-senv)))
-(define (make-comparer closing-senv use-senv form)
+(define (make-id=? closing-senv use-senv form)
(lambda (reference #!optional comparand)
(let ((comparand (if (default-object? comparand) form comparand)))
(and (identifier? comparand)
(identifier=? closing-senv reference use-senv comparand)))))
+(define (make-id!=? closing-senv use-senv form)
+ (lambda (reference #!optional comparand)
+ (let ((comparand (if (default-object? comparand) form comparand)))
+ (and (identifier? comparand)
+ (not (identifier=? closing-senv reference use-senv comparand))))))
+
(define-deferred spar-arg:form (string->uninterned-symbol ".form."))
(define-deferred spar-arg:hist (string->uninterned-symbol ".hist."))
(define-deferred spar-arg:close (string->uninterned-symbol ".close."))
(define-deferred spar-arg:ctx (string->uninterned-symbol ".ctx."))
+(define-deferred spar-arg:id!=? (string->uninterned-symbol ".id!=?."))
(define-deferred spar-arg:id=? (string->uninterned-symbol ".id=?."))
(define-deferred spar-arg:senv (string->uninterned-symbol ".senv."))
(define-deferred spar-arg:value (string->uninterned-symbol ".value."))
(define-deferred spar-arg:values (string->uninterned-symbol ".values."))
-
+\f
(define (spar-match predicate . args)
(lambda (input senv output success failure)
(if (apply (%subst-arg input senv output predicate)
((form) spar-arg:form)
((hist) spar-arg:hist)
((close) spar-arg:close)
+ ((id!=?) spar-arg:id!=?)
((id=?) spar-arg:id=?)
((senv) spar-arg:senv)
((value) spar-arg:value)