Larry Wall <[EMAIL PROTECTED]> writes: > We could make "return" a method as well as a built-in sub. That gives us > > Loop.return($x) > Sub.return($x) > Topic.return($x) > Thread.return($x) > Block.return($x) > There.return($x) > > or > > return Loop: $x > return Sub: $x > return Topic: $x > return Thread: $x > return Block: $x > return There: $x > > BLOCK_NAME could come in under a rule that says that if the classname lookup > on an identifier fails, and there's an outer labeled scope of that name, > it is treated as a reference to that object. Otherwise it's an error, > since we don't do barewords anymore. > > I suppose a case could be made that the innermost block scope is > really named MY, not Block. So it could be MY.return($x). > > If the method is named "return" however, we might run into ambiguity with > > return $x;
How about, if 'caller' returns a continuation... class Object; method return { MY.caller.return(@_) } -- Piers "It is a truth universally acknowledged that a language in possession of a rich syntax must be in need of a rewrite." -- Jane Austen?