develooper Front page | perl.perl6.language | Postings from August 2001

Re: properties, revisited

Thread Previous | Thread Next
From:
Jonathan Scott Duff
Date:
August 8, 2001 08:14
Subject:
Re: properties, revisited
Message ID:
20010808101356.C28604@cbi.tamucc.edu
On Wed, Aug 08, 2001 at 08:25:57AM +1000, Damian Conway wrote:
>    > More questions regarding the new 'given when' construct.
>    > [ LABEL: ] given ( expr_1 ) {
>    >            [ when expr_2 : block ...]
>    >            expr_n [;]
>    >             }
> 
> Not required. It's:
> 
>         [ LABEL: ] given ( expr_1 ) {
>                 [statement ; ...]
>                 [statement]
>         }
> 
> A C<when> statement is just a particular kind of statement.

Hmm.  C<when> seems to be synonymous with C<if> (almost)

	when ($foo) { ... }		# Does this mean if ($_ eq $foo)?
	 if  ($foo) { ... }

However ...

> A C<next> within a C<when>'s block causes control to jump to the next
> statement in the innermost surrounding <given>'s block.

What happens to C<next> within stand-alone C<when> statements? Do
C<when> statements never stand alone? And if C<when> and C<if> are
mostly synonymous, the differing behavious of C<next> within them would
be confusing.

-Scott
-- 
Jonathan Scott Duff
duff@cbi.tamucc.edu

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