RE: $a in @b (RFC 199)

2000-09-18 Thread Garrett Goebel
From: Tom Christiansen [mailto:[EMAIL PROTECTED]] From: Jarkko Hietaniemi I find this urge to push exceptions everywhere quite sad. Rather. Languages that have forgotten or dismissed error returns, turning instead to exceptions for everything in an effort to make the code "safer",

Re: $a in @b (RFC 199)

2000-09-18 Thread Tom Christiansen
From: Tom Christiansen [mailto:[EMAIL PROTECTED]] From: Jarkko Hietaniemi I find this urge to push exceptions everywhere quite sad. Rather. Languages that have forgotten or dismissed error returns, turning instead to exceptions for everything in an effort to make the code "safer",

RE: $a in @b (RFC 199)

2000-09-18 Thread Garrett Goebel
From: Tom Christiansen [mailto:[EMAIL PROTECTED]] From: Garrett Goebel There seems to be some general consensus that some people would like to be able to short-circuit functions like grep. Do you see no need for the code block equivalent of Cnext/Clast/Credo? What, you mean like

Re: $a in @b (RFC 199)

2000-09-17 Thread Tom Christiansen
I find this urge to push exceptions everywhere quite sad. Rather. Languages that have forgotten or dismissed error returns, turning instead to exceptions for everything in an effort to make the code "safer", tend in fact to produce code that is tedious and annoying. Read the new KP: "failing

Re: $a in @b (RFC 199)

2000-09-14 Thread John Porter
David L. Nicol wrote: This ability to jump to "the right place" is exactly what exception handling is for, as I understand it. Exceptions allow us to have one kind of block and any number of kinds of exit mechanisms. If qC(last die return) are all excpetions, the can travel up the call

Re: $a in @b (RFC 199)

2000-09-14 Thread David L. Nicol
'John Porter' wrote: David L. Nicol wrote: "Randal L. Schwartz" wrote: I think we need a distinction between "looping" blocks and "non-looping" blocks. And further, it still makes sense to distinguish "blocks that return values" (like subroutines and map/grep blocks) from

Re: $a in @b (RFC 199)

2000-09-14 Thread 'John Porter'
David L. Nicol wrote: "Randal L. Schwartz" wrote: I think we need a distinction between "looping" blocks and "non-looping" blocks. And further, it still makes sense to distinguish "blocks that return values" (like subroutines and map/grep blocks) from either of those. But I'll need

Re: $a in @b (RFC 199)

2000-09-14 Thread Jarkko Hietaniemi
David L. Nicol wrote: "Randal L. Schwartz" wrote: I think we need a distinction between "looping" blocks and "non-looping" blocks. And further, it still makes sense to distinguish "blocks that return values" (like subroutines and map/grep blocks) from either of those. But

Re: $a in @b (RFC 199)

2000-09-14 Thread 'John Porter'
Jarkko Hietaniemi wrote: In the other camp, Cyield has been suggested; but the conflation of that with its thread-related semantics may not be a such good idea. Cpass. Well, "pass" might be o.k.; but it usually means something going *into* a sub, not coming out... -- John Porter

Re: $a in @b (RFC 199)

2000-09-14 Thread Jarkko Hietaniemi
On Thu, Sep 14, 2000 at 11:46:31AM -0400, 'John Porter' wrote: Jarkko Hietaniemi wrote: In the other camp, Cyield has been suggested; but the conflation of that with its thread-related semantics may not be a such good idea. Cpass. Well, "pass" might be o.k.; but it usually means

Re: $a in @b (RFC 199)

2000-09-14 Thread John Porter
David L. Nicol wrote: This ability to jump to "the right place" is exactly what exception handling is for, as I understand it. Exceptions allow us to have one kind of block and any number of kinds of exit mechanisms. If qC(last die return) are all excpetions, the can travel up the call

Re: $a in @b (RFC 199)

2000-09-14 Thread David L. Nicol
'John Porter' wrote: David L. Nicol wrote: "Randal L. Schwartz" wrote: I think we need a distinction between "looping" blocks and "non-looping" blocks. And further, it still makes sense to distinguish "blocks that return values" (like subroutines and map/grep blocks) from

RE: $a in @b (RFC 199)

2000-09-13 Thread Garrett Goebel
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Garrett Goebel [EMAIL PROTECTED] writes: I agree... why can't a block be a block? Or put another way, instead of trying to shoehorn in something new, why don't we take away something old and treat all the blocks the same under Perl

Re: $a in @b (RFC 199)

2000-09-13 Thread David L. Nicol
"Randal L. Schwartz" wrote: I think we need a distinction between "looping" blocks and "non-looping" blocks. And further, it still makes sense to distinguish "blocks that return values" (like subroutines and map/grep blocks) from either of those. But I'll need further time to process

Re: $a in @b (RFC 199)

2000-09-12 Thread Graham Barr
On Mon, Sep 11, 2000 at 04:41:29PM -0500, Jarkko Hietaniemi wrote: Allow me to repeat: instead of trying to shoehorn (or piledrive) new semantics onto existing keywords/syntax, let's create something new. The blocks of grep/map/... are special. They are not quite looping blocks, they are not

Re: $a in @b (RFC 199)

2000-09-12 Thread Steve Fink
Jarkko Hietaniemi wrote: Allow me to repeat: instead of trying to shoehorn (or piledrive) new semantics onto existing keywords/syntax, let's create something new. The blocks of grep/map/... are special. They are not quite looping blocks, they are not quite sub blocks, they are different.

Re: $a in @b (RFC 199)

2000-09-12 Thread 'John Porter'
Steve Fink wrote: So, why not get rid of the specialness? Why can't all blocks return their last value? Then we would have sub BLOCKs and loop BLOCKs. 'return' would escape the nearest enclosing sub BLOCK and return a value. last/redo/next would escape/repeat/continue the enclosing

RE: $a in @b (RFC 199)

2000-09-12 Thread Garrett Goebel
From: Steve Fink [mailto:[EMAIL PROTECTED]] Jarkko Hietaniemi wrote: Allow me to repeat: instead of trying to shoehorn (or piledrive) new semantics onto existing keywords/syntax, let's create something new. The blocks of grep/map/... are special. They are not quite looping blocks,

Re: $a in @b (RFC 199)

2000-09-12 Thread Randal L. Schwartz
"Garrett" == Garrett Goebel [EMAIL PROTECTED] writes: Garrett I agree... why can't a block be a block? Or put another way, instead of Garrett trying to shoehorn in something new, why don't we take away something old Garrett and treat all the blocks the same under Perl 6? You mean this would no

RE: $a in @b (RFC 199)

2000-09-11 Thread Garrett Goebel
From: John Porter [mailto:[EMAIL PROTECTED]] Randal L. Schwartz wrote: Yes, I'd be in favor of making return() in a valued block (as opposed to a looping block) abort the block early and return the value. Imho, it should return the value, but not abort the block. I.e. stick

RE: $a in @b (RFC 199)

2000-09-11 Thread Garrett Goebel
From: Nathan Wiger [mailto:[EMAIL PROTECTED]] Ariel Scolnicov wrote: Chaim Frenkel [EMAIL PROTECTED] writes: yield EXPR - stop what I am doing now and give something else a a chance to do its things. And while you are doing that please take this

Re: $a in @b (RFC 199)

2000-09-11 Thread 'John Porter'
Garrett Goebel wrote: I'd be surprised if sub mygrep (@) { my ($coderef, @list, @stack) = @_; $coderef and push(@stack, $_) foreach (@list); return @stack; } @a = mygrep { return ($_ = 2) ? 1 : 0 } (1, 2, 3, 2, 1); print "\@a = @a\n"; Resulted in: @a = Instead of the

Re: $a in @b (RFC 199)

2000-09-11 Thread Jarkko Hietaniemi
On Mon, Sep 11, 2000 at 05:31:33PM -0400, 'John Porter' wrote: Garrett Goebel wrote: I'd be surprised if sub mygrep (@) { my ($coderef, @list, @stack) = @_; $coderef and push(@stack, $_) foreach (@list); return @stack; } @a = mygrep { return ($_ = 2) ? 1 : 0 } (1,