Daniel (>), Carl (>>):
>> That is all good and well for exiting the map itself; but what I want
>> to achieve is to exit the surrounding sub or method block. Example:
> Er... I mean actually the opposite... it should always return from the
> surrounding sub or method, never only from "map", if you want to "end"
> the map loop, you should use "last"... meaning...
> sub foo {
>   map { last; }, 1, 2, 3; # executes the block only once
>   map { return; }, 1, 2, 3; # returns from &foo;
> }

Ok, I realize I've been misunderstanding both your bug report and your
stated opinion when we talked about this on #perl6 the other day. I
thought you wanted 'return' inside a map block to act as if it were
within an invisible sub body (making both snippets of code in the
ticket return 2 instead of 1). Your actual request makes much more
sense. :)

As a plus side, I now suddenly understand what you mean by 'return'
being lexically bound. That's both DWIMmy and cool.

// Carl

Reply via email to