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

Re: S6: Change in if syntax?

Thread Previous | Thread Next
From:
Michael Lazzaro
Date:
April 22, 2003 09:32
Subject:
Re: S6: Change in if syntax?
Message ID:
C207523D-74E0-11D7-807B-00050245244A@cognitivity.com

>>>> #   if ( $foo    {bar}     # whitespace to line up subscripts,
>>>> #   or   $piddle {far} ) { # but parens required
>>>> #       boo();
>>>> #   }
>>>>
>>>> I would imagine (read: "hope") that the no-whitespace thing would
>>>> be tiebreaking rule, i.e. "if you can't tell, assume it's a
> block".
>>>
>>> Ditto. Anybody know for sure?

Absolutism was confirmed about a week ago:

On Sunday, April 13, 2003, at 03:04  AM, Damian Conway wrote:
> Nope. It's a hard-and-fast part of the syntax. Absolutely no 
> whitespace in variable accesses. Not under any circumstances. Never.
>
> At least, not until you explicitly modify the grammar to allow it. ;-)
>
> Damian

But note that it probably isn't too bad, because I imagine you can 
still use the method op (e.g. dot) to get that effect:

     if ( $foo    .{bar}
     or   $biddle .{bar} ) {...}

I'm pretty content with that, myself, in exchange for making the parens 
optional for things like C<if>.

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