[Issue 4660] Different writeln output for lazy sequences

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Aug 15 10:31:17 PDT 2014


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

bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #7 from bearophile_hugs at eml.cc ---
(In reply to Kenji Hara from comment #4)
> writeln formats all ranges by using the style [a, b, ...].

That's the default I'd like to change.


> And array is a range in D.

Also a string is a range, but it gets a different output, it doesn't look like
an array of chars.

For the programmer a lazy range and an eager one are quite different in D (in
Haskell they are more transparent).


> Additionally, writeln always evaluate all range elements to print them.

But probably writeln doesn't collect all the items before printing them, it
probably converts them one at a time (otherwise writeln needs an improvement).
So the information of the eagerness or lazyness of the given range is still
available inside writeln.


> If you want the semicolon-separated style, use the format specifiers "%( ...
> %| ... %)".

This is useless, as I explained above, because the point of the ";" is to give
me information. There's little point in giving information, and even as a
convention no one else will adopt it.

I think you are missing the point, but it doesn't matter much, because it's not
very important. Closed issue as wontfix.

--


More information about the Digitalmars-d-bugs mailing list