[Issue 4661] Array of lazy sequence

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 17 15:51:52 PDT 2010


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


David Simcha <dsimcha at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dsimcha at yahoo.com
         Resolution|                            |INVALID


--- Comment #1 from David Simcha <dsimcha at yahoo.com> 2010-08-17 15:51:49 PDT ---
This bug is invalid because of the way template instantiation from string
lambdas works.  Instantiating map with q{a + 1} produces a completely different
type than map instantiated with q{a + 2}, and therefore storing them in an
array should not be possible.  Take a look at how Map and
std.functional.unaryFun() work.  Also, to illustrate my point, note that the
following code works:

import std.algorithm: map;
void main() {
    auto r1 = map!q{a+1}([1, 2, 3]);
    auto r2 = map!q{a+1}([1, 2, 3]);
    auto a = [r1, r2];
}

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