Re: Popping an empty stack

2004-08-18 Thread Dan Sugalski
At 5:53 PM -0700 8/17/04, Brent 'Dax' Royal-Gordon wrote: Michel Pelletier <[EMAIL PROTECTED]> wrote: if Perl or other languages want an undef returned, it would seem to make more sense that they assume to cost of catching the exception and turning it into an undef, than everyone else turning th

Re: Popping an empty stack

2004-08-17 Thread Brent 'Dax' Royal-Gordon
Michel Pelletier <[EMAIL PROTECTED]> wrote: > if Perl or other languages want an undef returned, it would seem to make > more sense that they assume to cost of catching the exception and > turning it into an undef, than everyone else turning the undef into an > exception. I believe that this is ex

Re: Popping an empty stack

2004-08-17 Thread Michel Pelletier
ng a catchable error if the array is empty on pop: pop $P0, .STACK # throws exception if Perl or other languages want an undef returned, it would seem to make more sense that they assume to cost of catching the exception and turning it into an undef, than everyone else turning the undef into an exception. Popping an empty stack to feels much more "exceptional" to me than an operation that results in an undef. -Michel

Re: Popping an empty stack

2004-08-17 Thread Larry Wall
On Tue, Aug 17, 2004 at 03:15:01AM -0600, Luke Palmer wrote: : Michel Pelletier writes: : > > We have to through an IndexError exception for Python. But that's not : > > done yet. : > : > Okay, I'll keep depth checking. I thought about attempting a patch, but : > Larry says return an undef contai

Re: Popping an empty stack

2004-08-17 Thread Luke Palmer
Michel Pelletier writes: > > We have to through an IndexError exception for Python. But that's not > > done yet. > > Okay, I'll keep depth checking. I thought about attempting a patch, but > Larry says return an undef containing an unthrown exception, Dan wonders > if it should be an empty undef,

Re: Popping an empty stack

2004-08-17 Thread Michel Pelletier
On Tue, 17 Aug 2004 08:54:32 +0200 Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Michel Pelletier <[EMAIL PROTECTED]> wrote: > > > $P0 = new .PerlArray > > pop $P1, $P0 > > > kills the process with a 'Array index out of bounds!'. Is there a way > > to get an exception I can catch out of this? >

Re: Popping an empty stack

2004-08-17 Thread Leopold Toetsch
Michel Pelletier <[EMAIL PROTECTED]> wrote: > $P0 = new .PerlArray > pop $P1, $P0 > kills the process with a 'Array index out of bounds!'. Is there a way > to get an exception I can catch out of this? We have to through an IndexError exception for Python. But that's not done yet. > -Michel le

Re: Popping an empty stack

2004-08-16 Thread Dan Sugalski
At 10:51 AM -0700 8/16/04, Larry Wall wrote: On Mon, Aug 16, 2004 at 05:09:45AM -0700, Michel Pelletier wrote: : : $P0 = new .PerlArray : pop $P1, $P0 : : kills the process with a 'Array index out of bounds!'. Is there a way : to get an exception I can catch out of this? Right now I check the : d

Re: Popping an empty stack

2004-08-16 Thread Larry Wall
On Mon, Aug 16, 2004 at 05:09:45AM -0700, Michel Pelletier wrote: : : $P0 = new .PerlArray : pop $P1, $P0 : : kills the process with a 'Array index out of bounds!'. Is there a way : to get an exception I can catch out of this? Right now I check the : depth every time I want to pop, which adds a

Popping an empty stack

2004-08-16 Thread Michel Pelletier
$P0 = new .PerlArray pop $P1, $P0 kills the process with a 'Array index out of bounds!'. Is there a way to get an exception I can catch out of this? Right now I check the depth every time I want to pop, which adds a lot of overhead per pop. TIA, -Michel