Thread overview | |||||
---|---|---|---|---|---|
|
November 26, 2011 [Issue 7010] New: Purity of map and filter | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=7010 Summary: Purity of map and filter Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2011-11-25 16:39:07 PST --- There are some important cases where the purity inference of functions/delegates is not working well enough (DMD 2.057head): import std.algorithm: map, filter; int foo(immutable int x) pure nothrow { return 1; } void main() pure { immutable data = [1, 2, 3]; auto m1 = map!((x){ return 1; })(data); // OK auto m2 = map!((int x){ return 1; })(data); // OK auto m3 = map!q{ 1 }(data); // error, map is not pure auto m4 = map!foo(data); // error, map is not pure //------------ auto f1 = filter!((x){ return 1; })(data); // OK auto f2 = filter!((int x){ return 1; })(data); // OK auto f3 = filter!q{ 1 }(data); // error, filter is not pure auto f4 = filter!foo(data); // error, filter is not pure } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 26, 2011 [Issue 7010] Purity of map and filter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=7010 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|DMD |Phobos --- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-25 22:39:24 PST --- The instantiation of map function given a delegate literal should not be inferred as pure, it is compiler bug. I've separated the issue into bug 7017. Then this issue is now purely Phobos enhancement. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
July 09, 2013 [Issue 7010] Purity of map and filter | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=7010 hsteoh@quickfur.ath.cx changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |hsteoh@quickfur.ath.cx Resolution| |WORKSFORME --- Comment #2 from hsteoh@quickfur.ath.cx 2013-07-09 09:01:21 PDT --- This appears to have been fixed in git HEAD. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation