Re: display() and its pretty format

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...
DerekParnell said...

Good question. I'll look into that, but I'm guessing that it depends on one's idea of what "pretty" means.

I think we've effectively defined "pretty" here: Pretty Printing.

docs said...

Print an object to a file or device, using braces {,,,}, indentation, and multiple lines to show the structure.

-Greg

Ok, both display() and format() use the pretty_print() routine. The difference is that when display() is called without any formatting tokens, it uses pretty_print() with the prettifying argument as {2}, but when display() is called using formatting tokens, it calls pretty_print() using the prettifying argument of {2,0,1,1000,"%d",fmt,32,127,1,0}. To save you looking up the meaning of all those options, the first one uses all the defaults for pretty printing (2-col indent, line breaks at end of subsequences, etc) but the second one explicitly says something along the lines of... make the pretty string one single line and make it as short as possible.

If you require an enhancement to format() to enable it to be supplied with prettifying options of your own choice, we can add that to the list of things to do.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu