Re: explicit line termination with ";": why?

2007-05-15 Thread Jonathan Lang
Larry Wall wrote: Dave Whipp wrote: : A slightly tangental thought: is the behavior of C with no block : defined? I.e. is It would be illegal syntax currently. As I understand it, the proposal is to say that if the parser finds a ';' where it was expecting to find a control block, it treats th

Re: explicit line termination with ";": why?

2007-05-15 Thread Daniel Hulme
On Tue, May 15, 2007 at 01:14:44PM -0600, Luke Palmer wrote: > However, I do think that it's useful to be able to treat the rest of > the current scope as a block (usually with a parameter), for certain > kinds of closure-heavy code. Maybe this is a case for one of Mr. Lang's custom semicolons with

Re: explicit line termination with ";": why?

2007-05-15 Thread Larry Wall
On Tue, May 15, 2007 at 11:59:35AM -0700, Dave Whipp wrote: : Jonathan Lang wrote: : : >Close. I'm thinking "added functionality for semicolon alternatives" : >rather than the "replace the semicolon" stunt that Semi::Semicolons : >pulls. In particular, as long as there's no ambiguity between : >

Re: explicit line termination with ";": why?

2007-05-15 Thread Luke Palmer
On 5/15/07, Dave Whipp <[EMAIL PROTECTED]> wrote: A slightly tangental thought: is the behavior of C with no block defined? I.e. is given $foo { when 1 {...} }; equivalent to given $foo; when 1 {...}; Doubtful. However, I do think that it's useful to be able to treat the rest of the current

Re: explicit line termination with ";": why?

2007-05-15 Thread Dave Whipp
Jonathan Lang wrote: Close. I'm thinking "added functionality for semicolon alternatives" rather than the "replace the semicolon" stunt that Semi::Semicolons pulls. In particular, as long as there's no ambiguity between prefix: and postfix:, I think that it would be quite useful for postfix: t

Re: explicit line termination with ";": why?

2007-05-14 Thread John Macdonald
On Tue, May 15, 2007 at 02:02:06AM +0200, Thomas Wittek wrote: > John Macdonald schrieb: > > It's also, in many cases, > > harder to edit - that's why a trailing comma in a list that > > is surrounded by parens, or a trailing semicolon in a block > > surrounded by braces, is easier to manage. > >

Re: explicit line termination with ";": why?

2007-05-14 Thread Jonathan Lang
On 5/14/07, Daniel Hulme <[EMAIL PROTECTED]> wrote: On Mon, May 14, 2007 at 02:29:11PM -0700, Jonathan Lang wrote: > 2. This brings up the possibility of custom-designed termination > operators. cf. Semi::Semicolons. Close. I'm thinking "added functionality for semicolon alternatives" rather

Re: explicit line termination with ";": why?

2007-05-14 Thread Thomas Wittek
John Macdonald schrieb: > It's also, in many cases, > harder to edit - that's why a trailing comma in a list that > is surrounded by parens, or a trailing semicolon in a block > surrounded by braces, is easier to manage. Now that the list is surrounded by parens makes clear that it ends with the c

Re: explicit line termination with ";": why?

2007-05-14 Thread John Macdonald
On Tue, May 15, 2007 at 01:22:48AM +0200, Thomas Wittek wrote: > Andrew Shitov: > > If the line of code is not ended with ';' the parser tries first > > to assume [..] > > Wouldn't that be unambigous? > > foo = 23 > bar = \ >42 > > ? > > I think there would be no ambiguities and you o

Re: explicit line termination with ";": why?

2007-05-14 Thread Thomas Wittek
Andrew Shitov: > If the line of code is not ended with ';' the parser tries first > to assume [..] Wouldn't that be unambigous? foo = 23 bar = \ 42 ? I think there would be no ambiguities and you only had to add additional syntax for the rare cases instead of the common cases. -- Tho

Re: explicit line termination with ";": why?

2007-05-14 Thread Daniel Hulme
On Mon, May 14, 2007 at 02:29:11PM -0700, Jonathan Lang wrote: > 2. This brings up the possibility of custom-designed termination > operators. cf. Semi::Semicolons. I think that being flexible enough that people can write packages like that is one of Perl < 6's greatest strengths. Long may it con

Re: explicit line termination with ";": why?

2007-05-14 Thread Jonathan Lang
Jonathan Lang wrote: ^[3]: If this were included in the core, you might even reverse things so that ';' is defined in terms of postfix:<.> or infix:{'<=='}, depending on the context; in this case, postfix: would be defined in terms of postfix:<.>, rather than postfix:<;>. In fact, the only thing

Re: explicit line termination with ";": why?

2007-05-14 Thread Jonathan Lang
gabriele renzi wrote: Hi everyone, I don't want to argue about the design of perl6, I just wonder: why the semicolon is still needed in the end of lines in perl6? It isn't - sometimes. S03 identifies a number of ways that an expression can be terminated: the semicolon (';'), a block-final ('}

Re: explicit line termination with ";": why?

2007-05-14 Thread Aankhen
On 5/14/07, Andrew Shitov <[EMAIL PROTECTED]> wrote: JavaScript allows to omit semicolumn. Speaking of JavaScript, any experienced JavaScript programmer will tell you that while semi-colons are in fact optional, you should always treat them as mandatory, to avoid subtle errors creeping into you

Re: explicit line termination with ";": why?

2007-05-14 Thread Larry Wall
On Mon, May 14, 2007 at 07:05:01PM +0200, gabriele renzi wrote: : Hi everyone, : : I don't want to argue about the design of perl6[1], I just wonder: why : the semicolon is still needed in the end of lines in perl6? : : I can think of different reasons (history, readability, easier parsing : of

Re: explicit line termination with ";": why?

2007-05-14 Thread Andrew Shitov
> I don't want to argue about the design of perl6[1], I just wonder: why > the semicolon is still needed in the end of lines in perl6? JavaScript allows to omit semicolumn. In lecture at Yahoo's YUI Theatre one of JS's gurus talked about how it is organized in JavaScript parser. If the line of co