'pp' for D?
linkrope
linkrope at github.com
Tue Oct 1 12:47:15 PDT 2013
On Tuesday, 1 October 2013 at 07:30:06 UTC, Jacob Carlborg wrote:
> On 2013-09-30 23:56, bearophile wrote:
>
>> Surely Phobos should add a prettyPrinting() function, like the
>> function
>> of Python standard library.
>
> I would rather have function that generates a pretty
> representation of a given value. Then it either can be used to
> print the representation or something else.
How about "%r" in 'format'?
Then for arrays, "%(%s, %)" would in fact be "%(%r, %)" while
"%-(%s, %)" would in fact be "%(%s, %)" - breaking existing code;
punishable by 'xxformat' for at least one year :-)
More information about the Digitalmars-d-learn
mailing list