higher-order functions

spir denis.spir at gmail.com
Sun Oct 31 14:56:55 PDT 2010


On Sun, 31 Oct 2010 17:31:54 -0400
"Nick Sabalausky" <a at a.a> wrote:

> "spir" <denis.spir at gmail.com> wrote in message 
> news:mailman.45.1288523296.21107.digitalmars-d-learn at puremagic.com...
> >
> >Also, I could not find functional methods like map, filter,
> > reduce in std.functional. Where else? Also not in std.array.
> 
> std.algorithm. But the docs for it do need to be improved.

I find it very strange that map/filter/reduce take *strings* as func expressions, instead of function literals:
	int[] arr = [ 1, 2, 3, 4 ];
	auto squares = map!("a * a")(arr);
Why then have func literal? Func parameter is precisely the place where programmers like to use them, isn't it? Isn't this a sign that D func literals are not considered as practical enough?

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d-learn mailing list