On Mon, Feb 03, 2003 at 08:19:29PM -0500, Miko O'Sullivan wrote:
> On Tue, 4 Feb 2003, [iso-8859-1] Stéphane Payrard wrote:
> 
> > In the tradition of Perl concision, I would like newline to be a
> > statement terminator everywhere it can: that is when
> >        a) the parser expects an operator
> >  _and_ b)  we are not in the middle of a parenthesised expression.
> 
> 
> I don't mean to be abrupt here, especially seeing as how this list has
> been so patient with some of my ideas but... PLEASE NO.  The rules you
> suggest for keeping track of when a semicolon is required sound more
> confusing than the simple rule of "end of statement, put semicolon".  

As Luke Palmer said, in perl6, semicolon is a statement separator not a
statement terminator. So there is no such simple rule in Perl but you
are free to imposit it on yourself. Perl allows it but it does not
requires it.

> I like to break up my long statements in all sorts of arbitrary places, and
> adding the worries of when a newline might be significant puts a knot in
> my stomach just thinking about it (literally).
> 
> 

I agree that be obliged to check the next line to see if the newline
is or is not a statement terminator is not the nicest thing.
On the other hand, if the programmer is correctly indenting the program
it should stand out that the next line is part of the courant statement.


 print "-------"  # must read the next line to
                  #  figure out if new line is statement terminator or not
   if $condition";


Here indentation is a mere clue but has no syntactic meaning.


[snip]

--
 stef

Reply via email to