On
Jan 17, 2012, at 10:14 AM, Grant Husbands wrote:
Allen
Wirfs-Brock wrote:
do: arr.alternate ({|o| if
(...) continue; if (...) break; ...}, {|o| if
(...) continue; ...});
I don't see how
this can support the most likely intended semantics
I
think others might have better answers, but it seems that the
meaning
of 'break' is to stop the whole statement, and the meaning of
'continue'
is to skip the inner block and hence return to
arr.alternate. I'm
sorry for my woolly language, but it seems
relatively equivalent to a
for loop, in which 'break' stops the whole
statement and 'continue'
skips the inner block and hence returns to
the looping code.
Yes,
that was the intended meaning I was trying to express. But what I was
illustrating was that for this to work a continue wihout a target label
and an equivalently located break without a target label need to unwind
to different points in the enclosing nesting structure. This seems
different (perhaps surprisingly so) from equivalent continue/breaks
nested only within blocks and an
IterationStatement. But that is
the semantics that are need to fulfill my intent is this particular
case. Maybe this generalizes to all use reasonable cases, but it
something about it makes me feel a bit uncomfortable.