From cf9920dec5fb2e52eb872ee8cd91f356123223d1 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sat, 9 Aug 2014 23:29:31 -0700 Subject: [PATCH] Make gestalts equal?-comparable, and add a custom printer to avoid printing pain --- minimart/gestalt.rkt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/minimart/gestalt.rkt b/minimart/gestalt.rkt index 524522f..cbe41e7 100644 --- a/minimart/gestalt.rkt +++ b/minimart/gestalt.rkt @@ -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.