[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing display methods for structures, etc?



Quoting "Will Fitzgerald":
> Is there a method for defining a print method (like Common Lisp's
> PRINT-OBJECT) that would allow me print out the fields of the structure
> as well as the 'unique id' of the structure? This would help greatly in
> debugging.
> 
> For example:
> 
> #<struct:task 32323 :name my-task :priority 100>

(print-struct #t) is probably most of want you want for debugging:

 > (print-struct #t)
 > (seconds->date (current-seconds))
 #(struct:date 33 30 11 28 12 1999 2 361 #f -25200)

But there's currently no way to customize MzScheme's built-in printer,
other than the various parameters. `pretty-print' (in the pretty.ss
library) is configurable.

Matthew