Adding a custom printer similar to hasheq's for sets
svn: r18450
This commit is contained in:
parent
16b60586a5
commit
eec0ff66c6
|
@ -11,6 +11,15 @@
|
|||
|
||||
(define-struct set (ht)
|
||||
#:omit-define-syntaxes
|
||||
#:property prop:custom-write
|
||||
(lambda (s port write?)
|
||||
(define print (if write? write display))
|
||||
(write-string "#<set:" port)
|
||||
(set-for-each s
|
||||
(lambda (e)
|
||||
(write-string " " port)
|
||||
(print e port)))
|
||||
(write-string ">" port))
|
||||
#:property prop:equal+hash (list
|
||||
(lambda (set1 set2 =?)
|
||||
(=? (set-ht set1) (set-ht set2)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user