On Tue, 1 Apr 2003 22:01:48 +0300, arcadi shehter wrote:
> Damian Conway writes:
> > given baz(@args) { return $_ when defined }
> > given baz(@args) { return $_ when $_ > 0 }
> > # etc.
>
> since we have 2 forms of "return" -- "return" and "leave" , may be we
> can make "return" also to be a topicalizer for the rest of experssion
> , and then :
>
> return baz(@args) when $_ > 0 ;
> return baz(@args) when defined ;
> return baz(@args) when true ;
Damian's solution looks a lot better to me. I'm going to be surprised by the
behaviour of code that works like yours for a long time before I get used to
it.
--
Peter Haworth [EMAIL PROTECTED]
"I have to continue using UUCP for sentimental reasons"
-- Ian Lance Taylor