Make gestalts equal?-comparable, and add a custom printer to avoid printing pain

This commit is contained in:
Tony Garnock-Jones 2014-08-09 23:29:31 -07:00
parent f189dfdf4f
commit cf9920dec5
1 changed files with 7 additions and 1 deletions

View File

@ -76,7 +76,13 @@
;; -- Greg Egan, "Diaspora"
;; http://gregegan.customer.netspace.net.au/DIASPORA/01/Orphanogenesis.html
;;
(struct gestalt (metalevels))
(struct gestalt (metalevels)
#:transparent
#:methods gen:custom-write
[(define (write-proc g port mode)
(display "{{{" port)
(pretty-print-gestalt g port)
(display "}}}" port))])
;; Convention: A GestaltSet is a Gestalt where the Matchers map to #t
;; instead of (NonemptySetof PID) or any other value.