develooper Front page | perl.perl6.internals | Postings from July 2002

Re: [PATCH] perlarray strange behaviour

Thread Previous | Thread Next
From:
Jeff
Date:
July 1, 2002 18:59
Subject:
Re: [PATCH] perlarray strange behaviour
Message ID:
3D210716.3E758CFA@hargray.com
Josef Höök wrote:
> 
> i found some strange behaviour in perlarray.pmc
> Consider this code:
> 
>         new P0, .PerlArray, 2 # P0[2]
>         set P0, 2, 1 # P0[2] = 1
>         set P0, -4, 1 # P0[-4] = 1
> 
>         # Above runs some strange code:
>         # ix += SELF->cache.int_val
>         # where ix is our key
>         # in our case:
>         # ix = -4 + 2 , ix is now -2
>         # lets se if we have anything at key -2
> 
>         set I0, P0, -2
>         print I0
>         print "\n"
> 
>         end

It runs strange code because it depends upon partially-deprecated code.
Try 'set P0[2], 1' and 'set I0,P0[-2]'... I also note that P0[-4] should
likely throw an exception when we are able to test for exceptions.

The deprecated code should probably be removed, although I imagine we'll
find a new use for them later on.

Catching up on a week's worth of email here...
--
Jeff <jgoff@perl.org>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About