develooper Front page | perl.perl6.language | Postings from May 2007

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

Thread Previous | Thread Next
From:
Dave Whipp
Date:
May 15, 2007 11:58
Subject:
Re: explicit line termination with ";": why?
Message ID:
20070515185742.7356.qmail@lists.develooper.com
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:<?> to act as a semicolon that additionally sets $_ equal to
> the expression's value, allowing for a pseudo-Prolog style of syntax
> (i.e., the code could include questions as well as declarations and
> instructions).

A slightly tangental thought: is the behavior of C<given> with no block 
defined? I.e. is

given $foo { when 1 {...} };

equivalent to

given $foo;
when 1 {...};

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