develooper Front page | perl.perl6.language | Postings from April 2005

Re: Sun Fortress and Perl 6

Thread Previous | Thread Next
From:
Matt
Date:
April 27, 2005 06:46
Subject:
Re: Sun Fortress and Perl 6
Message ID:
op.spv8kelk8hsiyb@codeslut.kntnny.adelphia.net
On Wed, 27 Apr 2005 03:32:12 -0400, Autrijus Tang <autrijus@autrijus.org>  
wrote:
> 3. Labels applies to blocks, not statements
>
> Instead of this:
>
>     LABEL:
> 	say "Hello!"
> 	say "Hi!"
>
> One has to write this (essentially creating named blocks):
>
>     LABEL: {
> 	say "Hello!"
> 	say "Hi!"
>     }
>
> It makes sense because labels are frequently only used for block
> control; the only thing that requires them at the statement level
> is goto(), and you can still goto(LABEL) if you really want to.

I've missed out on some Perl6 stuff, so excuse me as this was probably  
already discussed.

Does that mean this is possible?

	my Int $i = 0;
	LABEL: {
		say $i;
		$i++;
		next if $i < 5;
	}

With no next/break/continue/whatever it is, the code block is executed  
only once.  But you still have the ability to treat it as a loop of sorts?

>
> 4. Software Transaction Memory
>

Yes! that would be awesome!  I've never used Haskell, but I can see the  
good uses for it :)


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