Re: Undef issues

2005-05-31 Thread Larry Wall
On Tue, May 24, 2005 at 10:53:59PM +1000, Stuart Cook wrote: : I'm not sure whether this behaviour is supposed to be changing. It is. I think we decided to make the value undef, and the function undefine(). (But these days most values of undef really ought to be constructed and returned (or thro

Re: Undef issues

2005-05-25 Thread Piers Cawley
Adrian Taylor <[EMAIL PROTECTED]> writes: > Hi, > > Over the weekend I added some tests on 'undef' behaviour > (t/builtins/undef.t): > > These behave as expected: > > eval_is('undef * 2', undef, 'undef * 2'); That's not what I'd expect. I'd expect it to return 0 and throw a warning about numifica

Re: Undef issues

2005-05-24 Thread Adrian Taylor
Hi Stuart, You (and Carl) are absolutely right... all these things are behaving as they should. Cool! :-) I'll fix the tests later on today. Thanks, Ade Stuart Cook wrote: >On 5/24/05, Adrian Taylor <[EMAIL PROTECTED]> wrote: > > >>eval_is('undef + 1', undef, 'undef + 1', :todo); # dies >>

Re: Undef issues

2005-05-24 Thread Stuart Cook
On 5/24/05, Adrian Taylor <[EMAIL PROTECTED]> wrote: > eval_is('undef + 1', undef, 'undef + 1', :todo); # dies In this case, you're expecting (undef) + 1 but you're getting undef(+1) instead. This is because 'undef' serves double-duty as both 'undefined value' and 'prefix op for undefining vari

Re: Undef issues

2005-05-24 Thread Carl Franks
> eval_is('undef + 1', undef, 'undef + 1', :todo); # dies > eval_is('1 + undef', undef, '1 + undef', :todo); # gives 1 I would expect these to both equal 1, see perl5 >perl5 -le "undef $_; ++$_; print" 1

Undef issues

2005-05-24 Thread Adrian Taylor
Hi, Over the weekend I added some tests on 'undef' behaviour (t/builtins/undef.t): These behave as expected: eval_is('undef * 2', undef, 'undef * 2'); eval_is('undef * undef', undef, 'undef * undef'); These don't (at least, according to my expectations...) eval_is('undef + 1', undef, 'undef +