On Thu, 17 Mar 2011 18:17:08 +0100, Steven Schveighoffer
<schvei...@yahoo.com> wrote:
On Thu, 17 Mar 2011 12:09:50 -0400, bearophile
<bearophileh...@lycos.com> wrote:
Steven Schveighoffer:
The only problem I see with it is the inline-killing.
Please don't ignore the purity-killing :-)
I think this is not as much an easy fix. By changing one line in
enforce, every instance becomes inlinable. By making enforce also pure,
it doesn't automatically make all users of enforce pure.
I thought that lazy enforce cannot be pure, but I realize now that it
can, as long as the delegate is pure. However, I think the compiler
won't cooperate with that.
Not currently, at least. This made me wonder. A delegate created inside a
pure function would have to be pure while in the scope of that function,
right? Seems to me that should be possible to implement.
--
Simen