Re: labeled if blocks

2002-11-03 Thread Bryan C. Warnock
On Mon, 2002-10-28 at 14:41, Larry Wall wrote: And maybe: A bitwise operator is just a logic operator scoped to a set of bits. Hypo-operators. :-) -- Bryan C. Warnock bwarnock(gtemail.net|raba.com)

Re: labeled if blocks

2002-10-28 Thread Larry Wall
On 27 Oct 2002, Marco Baringer wrote: : why not use - to create a sub which you can return from? : : if $foo - { : ... : return if $bar; : ... : } Except that by the current rule you can only Creturn from something that is declared with the word sub. -{...} is still just a fancy block

Re: labeled if blocks

2002-10-28 Thread Austin Hastings
How about leave? leave SURROUNDING | [SURROUNDING]IDENTIFIER [ [result] VALUE-SPEC ]; Aliases: = return - leave sub exit - leave program (or is it thread?) break - leave loop (this is shaky: does it deserve to be here?) last - leave block Extensions (these are WAY!

Re: labeled if blocks

2002-10-28 Thread Steve Canfield
From: Larry Wall [EMAIL PROTECTED] last almost works, except it's specific to loops But last also works for anonymous blocks, which aren't loops. (Aren't they? Don't know about you tovarisch, but my anonymous blocks execute just once.) In fact, that's why I asked. I have a lot of code that

RE: labeled if blocks

2002-10-28 Thread Brent Dax
Larry Wall: # last almost works, except it's specific # to loops, at least in Perl 5 semantics. I keep thinking of # ret as a little return, but that's mostly a placeholder # in my mind. I've got a lot of those... I don't see why Clast has to work only on loops, or why there can't be an

Re: labeled if blocks

2002-10-28 Thread Larry Wall
On Mon, 28 Oct 2002, Austin Hastings wrote: : How about leave? Right, that brings back some memories. : leave : SURROUNDING | [SURROUNDING]IDENTIFIER : [ [result] VALUE-SPEC ]; : : Aliases: : = : return - leave sub Right. : exit - leave program (or is it thread?) Hmm.

Fwd: Re: labeled if blocks

2002-10-28 Thread Austin Hastings
Sorry, forgot to hit reply-all. --- Austin Hastings [EMAIL PROTECTED] wrote: Date: Mon, 28 Oct 2002 12:58:16 -0800 (PST) From: Austin Hastings [EMAIL PROTECTED] Subject: Re: labeled if blocks To: Larry Wall [EMAIL PROTECTED] --- Larry Wall [EMAIL PROTECTED] wrote: On Mon, 28 Oct 2002

Re: labeled if blocks

2002-10-28 Thread Angel Faus
And maybe: A bitwise operator is just a logic operator scoped to a set of bits. That's why I can't accept a characterization of ++|+X - bitwise operations on int += +|= +X= ~~|~X - bitwise operations on str ~= ~|=

Re: labeled if blocks

2002-10-28 Thread Larry Wall
On Tue, 29 Oct 2002, Angel Faus wrote: : Could we please, please, please have bitwise operators be out of the : core. We expect that they are not going to be used by the average : user, so it looks fair to apply the ultimate negative huffman : enconding: they need to be specially required. : :

Re: labeled if blocks

2002-10-28 Thread Me
And that's also why we need a different way of returning from the innermost block (or any labelled block). last almost works, except it's specific to loops, at least in Perl 5 semantics. I keep thinking of ret as a little return, but that's mostly a placeholder in my mind. I've got a lot

Re: labeled if blocks

2002-10-28 Thread Marco Baringer
Larry Wall [EMAIL PROTECTED] writes: On 27 Oct 2002, Marco Baringer wrote: : why not use - to create a sub which you can return from? : : if $foo - { : ... : return if $bar; : ... : } Except that by the current rule you can only Creturn from something that is declared with the

average perl users? was: labeled if blocks

2002-10-28 Thread David Dyck
On Mon, 28 Oct 2002 at 14:50 -0800, Larry Wall [EMAIL PROTECTED] wrote: On Tue, 29 Oct 2002, Angel Faus wrote: : Could we please, please, please have bitwise operators be out of the : core. We expect that they are not going to be used by the average : user, so it looks fair to apply the

Re: labeled if blocks

2002-10-28 Thread Larry Wall
On 29 Oct 2002, Marco Baringer wrote: : Larry Wall [EMAIL PROTECTED] writes: : : On 27 Oct 2002, Marco Baringer wrote: : : why not use - to create a sub which you can return from? : : : : if $foo - { : : ... : : return if $bar; : : ... : : } : : Except that by the current rule

Re: average perl users? was: labeled if blocks

2002-10-28 Thread Larry Wall
On Mon, 28 Oct 2002, David Dyck wrote: : I admit that I use pack, bitwise operators, as well as 0x constants : in many of my scripts. I'm not sure what Angel means by taking : some of these things out of the core, but if my short perl5 scripts : start to grow to python length I'll have less

RE: average perl users? was: labeled if blocks

2002-10-28 Thread Brent Dax
Larry Wall: # I have historically preferred that approach. Certainly it's # something that could be enforced by a policy file too. An # intro to programming class is likely to have such a policy # file anyway: # # $ perl6 # use CS_101; # if $a | $b { # Prof. Roberts says you

Re: labeled if blocks

2002-10-28 Thread Piers Cawley
Larry Wall [EMAIL PROTECTED] writes: We could make return a method as well as a built-in sub. That gives us Loop.return($x) Sub.return($x) Topic.return($x) Thread.return($x) Block.return($x) There.return($x) or return Loop: $x return Sub: $x

Re: labeled if blocks

2002-10-27 Thread Erik Steven Harrison
-- On Sat, 26 Oct 2002 21:02:20 Larry Wall wrote: On Sat, 26 Oct 2002, Steve Canfield wrote: : Will Perl6 have labeled if blocks? Like this: : : BLAH: : if ($foo) { : ... : last BLAH if $bar; : ... : } I don't see why we need it offhand. But we might well have

Re: labeled if blocks

2002-10-27 Thread Marco Baringer
Steve Canfield [EMAIL PROTECTED] writes: Will Perl6 have labeled if blocks? Like this: BLAH: if ($foo) { ... last BLAH if $bar; ... } why not use - to create a sub which you can return from? if $foo - { ... return if $bar; ... } this of course means you

labeled if blocks

2002-10-26 Thread Steve Canfield
Will Perl6 have labeled if blocks? Like this: BLAH: if ($foo) { ... last BLAH if $bar; ... } _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp

Re: labeled if blocks

2002-10-26 Thread Larry Wall
On Sat, 26 Oct 2002, Steve Canfield wrote: : Will Perl6 have labeled if blocks? Like this: : : BLAH: : if ($foo) { : ... : last BLAH if $bar; : ... : } I don't see why we need it offhand. But we might well have something that returns out of the innermost {...} anyway, so