develooper Front page | perl.perl6.language | Postings from November 2003

RE: Control flow variables

Thread Previous | Thread Next
From:
Gordon Henriksen
Date:
November 19, 2003 05:42
Subject:
RE: Control flow variables
Message ID:
011701c3ae08$484097f0$cc54e8c7@domain.ma.iclub.com
No, because the

    if $a

from "return if $a;" doesn't match the production

    if <expression> <block> [else <block>]

I so don't want to be anywhere near the Perl6 parser...

--
 
Gordon Henriksen
IT Manager
ICLUBcentral Inc.
gordon@iclub.com


> -----Original Message-----
> From: Michael Lazzaro [mailto:mlazzaro@cognitivity.com] 
> Sent: Tuesday, November 18, 2003 2:06 PM
> To: perl6-language@perl.org
> Subject: Re: Control flow variables
> 
> 
> 
> On Tuesday, November 18, 2003, at 06:38 AM, Simon Cozens wrote:
> > Given that we've introduced the concept of "if" having a 
> return status:
> >
> >   my $result = if ($a) { $a } else { $b };
> >
> 
> Would that then imply that
> 
>      sub blah {
>        ...              # 1
>        return if $a;    # 2
>        ...              # 3
>      }
> 
> ...would return $a if $a was true, and fall through to (3) if it was 
> false?
> 
> 
> > dan@sidhe.org (Dan Sugalski) writes:
> >>> Luke Palmer:
> >>>> That's illegal anyway.  Can't chain statement modifiers :-)
> >> Will be able to.
> 
> I was under the strong impression that Larry had decided that 
> syntactic 
> ambiguities prevented this from happening.  (Now, of course, you will 
> ask me for a cite to the thread, which I can't even begin to find at 
> this point...)
> 
> MikeL
> 
> 



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About