[Issue 9582] std.algorithm.map!(T) cause CT error for fixed size arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 24 08:21:50 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9582



--- Comment #5 from monarchdodra at gmail.com 2013-02-24 08:21:49 PST ---
(In reply to comment #4)
> (In reply to comment #3)
> > ...and this is good example of why accepting an "iterable" as a function
> > argument, as opposed to a range, is usually a bad idea.
> > 
> > As for reduce accepting iterable, Andrei asked me to remove it in one of my
> > open requests, so don't expect it keep working for too long.
> > 
> > https://github.com/D-Programming-Language/phobos/pull/861#discussion_r2024457
> 
> std.array.array also accepts iterables. I think array and reduce are the only
> two.
> 
> Removing these is going to break a lot of code though.

For array, probably. For reduce, probably much less.

I think ideally, we should accept "isNonStaticArrayItterable":

The idea of "isIterable" is to accept stuff that is either a range, or has
opApply. Static arrays, while being iterable, shouldn't be passed around by
value to functions.

I think there'd be gains in the long run to such a scheme.

-- 
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