[Issue 2928] Swap order of paramaters for std.range's "take"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun May 3 14:06:39 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2928
------- Comment #3 from andrei at metalanguage.com 2009-05-03 16:06 -------
(In reply to comment #2)
> Keep in mind that Haskell's parameter ordering is based on partial application,
> a feature that D obviously does not have.
>
Sort of does:
import std.functional, std.range, std.stdio;
void main() {
auto a = [ 1, 2, 3 ][];
alias curry!(take, 2) take2;
foreach (e; take2(a)) { writeln(e); }
}
But I agree there are good arguments in favor of swapping arguments.
--
More information about the Digitalmars-d-bugs
mailing list