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

Re: Customizing hash table printing?



Quoting Hannu Koivisto:
> I saw those sections and even tried that approach but because I
> couldn't get it to work [...]

You're right that the default print handlers do not call back to the
installed print handler for printing substructures. Part of the reason
has to do with showing graph structures.

You might try using the pretty-print library, "pretty.ss", because it
does support hook procedures that apply to each subsctruture in the
printed value. The `pretty-print-size-hook' and
`pretty-print-print-hook' parameters allow you to supply an arbitrary
string result for displaying a hash table.

If you're not actually interested in the prettiness of the output, that
should work fine. But, if you do want "pretty" output, the pretty-print
library still odesn't provide enough parameters, yet: there's no hook
that can break the output into multiple lines and also pretty-print
nested structures.

Matthew