[Issue 6074] Assert expressions shouldn't have side effects
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun May 29 09:44:26 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6074
--- Comment #3 from kennytm at gmail.com 2011-05-29 09:40:03 PDT ---
(In reply to comment #2)
> (In reply to comment #1)
> > In the current stage, allowing only 'pure' function inside an 'assert' is
> > impractical, e.g. you can't use std.algorithm.equal.
>
> Can't equal be pure when not using a closure? I would think having side effects
> in asserts is always bad. If it's difficult to implement, at least the
> documentation should be changed.
Since 'pure' is transitive, if 'equal' needs to be pure, all range primitives
(.front, .popFront, .empty) it depends on needs to be pure as well, as then the
requirement propagates to all other ranges (map, filter, iota, zip, ...). This
is a very huge change.
This proposal is practical only when there is a working 'auto pure'
implementation, which I don't think will be included in D2 as the syntax is
pretty much frozen.
--
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