[Issue 4660] Different writeln output for lazy sequences

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Aug 14 11:36:31 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=4660

bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|andrei at erdani.com           |nobody at puremagic.com

--- Comment #3 from bearophile_hugs at eml.cc ---
(In reply to hsteoh from comment #2)
> Current workaround:
> 
> writefln("[%(%s; %)]", r);
> 
> Is this acceptable?

It's a simple workaround, but it misses my point: I have suggested to print
lazy sequences using ";" as items separator to help the programmer tell apart
lazy sequences from arrays (and array-like) data structures. So the purpose of
using ";" is to give more information to the programmer that sees a textual
output. If you use "[%(%s; %)]" to format a lazy range, you already know that
you are dealing with a lazy range, so the textual output is not giving you much
new information. So I think if we want to change this, it has to be a built-in
feature of writeln. Otherwise we can close down this ER as wontfix, because
it's not terribly important.

--


More information about the Digitalmars-d-bugs mailing list