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 the undef into an
 exception.

I believe that this is exactly the sort of language-specific behavior that PMCs were designed to solve.

Yup. But in this case the bounds checking is needed if you care, since:

   $bar = pop @foo;

should return undef if @foo is empty. Call it a thousand times and you should cheerfully get a thousand undefs. If code wants to see if there's actually anything in @foo, then it has to check. (In the perl 5 case, of course)

That should happen regardless of the language popping an element off of @foo.
--
                                Dan

--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to