On 30.07.20 18:08, MG wrote:
1. Hiding a semantic "if" inside a "for"-loop syntax is not good, in my
book - in C++ I would have introduced a "returnIf"-macro to make the
intention clear in that case... ;-)
2. I was also thinking along the same line, but more like:
if(it = goo(); a>6 && it>10) { return it }
How does the return know what to return in your example, btw... ?-)
3. Would the "it" variable in the ClosureList move from term to term,
i.e. it would always reference the last term before the current one, or
always refernce the first ?
the idea in the original ClosureList was that each element of the list
is a Closure, the only difference being that they share the same
variable scope. So (def it = goo(); a>6 && it>10; return it) would
absolutely allow for the declaration of a variable it, to be used in the
condition and the return. The method taking the ClosureList, here "if"
determines order and meaning of the elements..
What of course does not work is the return ;) Sorry, forgot that.
Cheers,
mg
PS: The difference between
returnIf (goo(); a>6 && it>10)
and
returnIf (goo(), a>6 && it>10)
is of course miniscule, and maybe the second variety might actually be
less confusing... (?)
yeah, I think if we go for that returnIf, we really should go for the
semicolon
bye Jochen