From 1384d2d2779938f7b2a6449b9f09fc8cc24de75a Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 25 Jun 2013 18:37:35 -0500 Subject: [PATCH] adjust the hole structs a little bit to get better printing at the REPL --- pkgs/redex/private/lang-struct.rkt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/redex/private/lang-struct.rkt b/pkgs/redex/private/lang-struct.rkt index e29eb6f255..9a4605df18 100644 --- a/pkgs/redex/private/lang-struct.rkt +++ b/pkgs/redex/private/lang-struct.rkt @@ -14,9 +14,16 @@ (define-struct rhs (pattern) #:transparent) (define-values (the-hole the-not-hole hole?) (let () - (define-struct hole (id) + (define-struct hole () #:property prop:equal+hash (list (λ (x y recur) #t) (λ (v recur) 255) (λ (v recur) 65535)) #:inspector #f) - (define the-hole (make-hole 'the-hole)) - (define the-not-hole (make-hole 'the-not-hole)) - (values the-hole the-not-hole hole?))) + (define-struct not-hole () + #:property prop:equal+hash (list (λ (x y recur) #t) (λ (v recur) 254) (λ (v recur) 65534)) + #:inspector #f) + (define the-hole (make-hole)) + (define the-not-hole (make-not-hole)) + (define -hole? + (let ([hole? + (λ (x) (or (hole? x) (not-hole? x)))]) + hole?)) + (values the-hole the-not-hole -hole?)))