Daniel Ruoso wrote:
In fact, I doubt that there's a way to completely avoid any possible
side effects on this closures. as the very first line of the closure
This is a plain method call, there's no way to tell if this method will
change anything inside the object or not.
Well, we could use something to the effect of const methods in C++.
That is we have a trait on a method that prevents changes of the
object. And these could be the only ones allowed in where blocks.
It's important to remember that, in Perl 6, something is only guaranteed
to be fully executed before the next statement when using short-circuit
operators, everything else is subject to eventually be made lazy, with
the exception of the feed operators, that explicitly say to assume lazy
So, no C++ sequence points or the like at all in the definition of
"The unavoidable price of reliability is simplicity" -- C.A.R. Hoare
"Simplicity does not precede complexity, but follows it." -- A.J. Perlis
1 + 2 + 3 + 4 + ... = -1/12 -- Srinivasa Ramanujan