--- Comment #14 from Kenji Hara <k.hara...@gmail.com> 2011-09-02 16:00:43 PDT
(In reply to comment #13)
> (In reply to comment #12)
> > https://github.com/D-Programming-Language/phobos/pull/126
> > All of ranges are formatted like "[elem1, elem2, ...]".
> I appreciate the work you are doing to improve D textual Input/Output.
> Regarding lazy ranges, generally I prefer the textual output to give me hints
> of what I have printed. So I'd like some difference between the textual
> representation of this array:
> [0, 1, 2]
> And this range:
> I think a simple way to tell them apart is to use a different separator.
> Functional languages sometimes use the semicolon to separate list items, so I
> think it's nice to print iota(3) like this:
> [0; 1; 2]
I think it is nonsense to distinguish formatting between eager range (like
array) and lazy range (like iota).
(1) today we cannot restore lazy range from already formatted output. We don't
have common interface to rebuild range from formatted string. Maybe OutputRange
is the I/F (call put(r, e0), put(r, e1), ... against range), but now almost
lazy ranges are not OutputRange.
And D is strict-typed language, so when you want to unformat range, you should
give range type first. So the separator will not be an issue.
(2) I think that the output like "[e0, e1, ..., eN]" is *range formatting*, not
array formatting, even if it looks like array. And an array is a kind of
ranges, so we should format them with *one* formatting.
>From the reasons, it seems to me that we have no necessary to distinguish range
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------