[Issue 2928] Swap order of paramaters for std.range's "take"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Dec 8 06:18:54 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2928
Lutger <lutger.blijdestijn at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lutger.blijdestijn at gmail.co
| |m
--- Comment #4 from Lutger <lutger.blijdestijn at gmail.com> 2009-12-08 06:18:52 PST ---
Please consider this also for replicate* and any other functions (though
replicate and take are the only ones I could find.)
Note that in haskell's prelude, there are many functions that also can be found
in phobos, such as splitAt and until, for which the same argument could be
made. Haskell does seem to be more consistent in argument ordering, always the
predicate first and then the list, this makes it easy to remember.
It's a bit weird that when uniform function call syntax will be implemented,
this will work:
iota(0,10).stride(2).until(8)
but this won't work:
iota(0,10).stride(2).take(4)
I'd rather give up currying myself to make this work, even for the benefit of
consistency alone.
* note that std.string.repeat is defined as string repeat(string s, size_t n);
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list