File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 169169 (struct->vector i2))))
170170 (define hash-proc (λ (i hash) (hash (struct->vector i))))
171171 (define hash2-proc (λ (i hash) (hash (struct->vector i))))]
172+
173+ #:property prop:custom-print-quotable 'never
172174 #:methods gen:custom-write
173175 [(define write-proc
174- (make-constructor-style-printer
176+ (instr-print 'Name )
177+ #; (make-constructor-style-printer
175178 (lambda (obj) 'Name )
176179 (lambda (obj)
177180 (rest (rest (vector->list (struct->vector obj)))))))])
178181 (define Name? %Name?)))]))
179182
183+ (define (instr-print type)
184+ (lambda (instr port mode)
185+ (if (number? mode)
186+ (write-string "( " port)
187+ (write-string "#(struct: " port))
188+ (write-string (symbol->string type) port)
189+ (let ([recur (case mode
190+ [(#t ) write]
191+ [(#f ) display]
192+ [else (lambda (p port) (print p port mode))])])
193+ (for-each (lambda (e)
194+ (write-string " " port)
195+ (recur e port))
196+ (rest (rest (vector->list (struct->vector instr))))))
197+ (if (number? mode)
198+ (write-string ") " port)
199+ (write-string ") " port))))
200+
201+
180202(instruct Text () check:none)
181203(instruct Data () check:none)
182204
You can’t perform that action at this time.
0 commit comments