Re: A proposal on if and else

2003-01-22 Thread Thom Boyer
Smylers wrote: Thom Boyer wrote: The primary advantage, to my mind, in using Celsif, is that it eliminates the dangling-else ambiguity -- so splitting it in half removes almost ALL the value of even having an Celsif keyword. Surely it's the compulsory braces, even with a single statement,

Re: A proposal on if and else

2003-01-21 Thread Dave Whipp
b rather than as a separate syntax is so the parser doesn't have to do anything special for special keywords. The specialness could be generalized, so that its no longer a parser hack: proposal rating='NOOOooo' #define elsif else if /idea Dave.

RE: A proposal on if and else

2003-01-21 Thread Thom Boyer
Rafael Garcia-Suarez [mailto:[EMAIL PROTECTED]] wrote: The tokeniser could send two tokens else and if whenever it recognizes the keyword elsif -- so this isn't a problem. The primary advantage, to my mind, in using Celsif, is that it eliminates the dangling-else ambiguity -- so splitting it in

Re: A proposal on if and else

2003-01-21 Thread Smylers
Thom Boyer wrote: The primary advantage, to my mind, in using Celsif, is that it eliminates the dangling-else ambiguity -- so splitting it in half removes almost ALL the value of even having an Celsif keyword. Surely it's the compulsory braces, even with a single statement, which eliminates

A proposal on if and else

2003-01-20 Thread Brent Dax
Many people have pointed out the 'semicolon problem' with if and else--that is, if Perl intuits a semicolon after every codeblock that ends a blank line, you would have to cuddle all your elses: if $cond { ... } -- Virtual semicolon here else

Re: A proposal on if and else

2003-01-20 Thread Rafael Garcia-Suarez
Brent Dax wrote in perl.perl6.language : Yes, I know this means that we have 'else if' instead of 'elsif', but it's only two more characters and it makes the grammar cleaner. The tokeniser could send two tokens else and if whenever it recognizes the keyword elsif -- so this isn't a problem.

Re: A proposal on if and else

2003-01-20 Thread Joseph F. Ryan
Rafael Garcia-Suarez wrote: Brent Dax wrote in perl.perl6.language : Yes, I know this means that we have 'else if' instead of 'elsif', but it's only two more characters and it makes the grammar cleaner. The tokeniser could send two tokens else and if whenever it recognizes the keyword

Re: A proposal on if and else

2003-01-20 Thread Joseph F. Ryan
Rafael Garcia-Suarez wrote: Joseph F. Ryan wrote in perl.perl6.language : I think the point of having Cif as a sub rather than as a separate syntax is so the parser doesn't have to do anything special for special keywords. I think the goal was to simplify the compiler, but with the

Re: A proposal on if and else

2003-01-20 Thread Rafael Garcia-Suarez
Joseph F. Ryan wrote in perl.perl6.language : If the final design stays the way it is now, there really won't be a lexer. Instead, a perl6 grammar parses the data, and builds up a huge match-object as it, well, matches. This match object is then munged into the optree. Oh, yes, I remember

A proposal for separable verbs. (Was: Re: A proposal on if and else)

2003-01-20 Thread Austin Hastings
--- Joseph F. Ryan [EMAIL PROTECTED] wrote: If the final design stays the way it is now, there really won't be a lexer. Instead, a perl6 grammar parses the data, and builds up a huge match-object as it, well, matches. This match object is then munged into the optree. With this in mind,

RE: A proposal for separable verbs. (Was: Re: A proposal on if and else)

2003-01-20 Thread Brent Dax
Austin Hastings: # Let's support separable verbs. # # Here's how: # # # Note my arbitrary selection of _ as separation indicator. # Feel free to replace this with something more appropriate: # # sub if($test, block) # _ elsif ($test, block) is optional is floating is multi # _

RE: A proposal for separable verbs. (Was: Re: A proposal on if and else)

2003-01-20 Thread Austin Hastings
--- Brent Dax [EMAIL PROTECTED] wrote: Austin Hastings: # Let's support separable verbs. # # Here's how: # # # Note my arbitrary selection of _ as separation indicator. # Feel free to replace this with something more appropriate: # # sub if($test, block) # _ elsif ($test,

Re: A proposal for separable verbs. (Was: Re: A proposal on if and else)

2003-01-20 Thread Simon Cozens
[EMAIL PROTECTED] (Austin Hastings) writes: Let's support separable verbs. That (http://dev.perl.org/perl6/rfc/309.html) is a really good idea. -- Writing software is more fun than working.