Should we have prettier string printing for exceptions and std elemts?

Seb seb at wilzba.ch
Tue Oct 10 13:51:43 UTC 2017


On Tuesday, 10 October 2017 at 11:17:09 UTC, bauss wrote:
> On Monday, 9 October 2017 at 18:52:03 UTC, Petar Kirov 
> [ZombineDev] wrote:
>> On Monday, 9 October 2017 at 17:44:12 UTC, jmh530 wrote:
>>> On Monday, 9 October 2017 at 17:19:42 UTC, Petar Kirov 
>>> [ZombineDev] wrote:
>>>>
> Printing the container
>> type, address and length would be most useful default IMO (but 
>> in a better looking way than what we have now for 
>> std.container.array).
>
> That's your opinion though; IMO I'd rather have the elements 
> printed by default.
>
> It's all subjective and thus there's no real reason for one or 
> the other.

FWIW I tried to propose a `dump` function one year ago [1].
There has never been a great interest in it though as while using 
`writeln` is a bit annoying (e.g. no spaces, no variable names) 
apparently all core people got used to it already ;-)

If someone considers to add a pretty printing method he/she, this 
new symbol could also be very useful for single elements too (and 
thus gain chances in its acceptance).

[1] 
https://github.com/dlang/phobos/pull/4318#issuecomment-241819997


More information about the Digitalmars-d mailing list