Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion resize_array (PerlArray)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Aldo Calpini  
View profile  
 More options Aug 1 2002, 12:04 pm
Newsgroups: perl.perl6.internals
From: dada.l...@alos.it (Aldo Calpini)
Date: Thu, 1 Aug 2002 17:28:12 +0200
Local: Thurs, Aug 1 2002 11:28 am
Subject: resize_array (PerlArray)

take this little assembler program:

        new P1, .PerlArray
        set P1, 100
        bsr GETLEN

        set I0, P1[0]
        print "P1[0]="
        print I0
        print "\n"
        bsr GETLEN

        set I0, P1[10000]
        print "P1[10000]="
        print I0
        print "\n"      
        bsr GETLEN
        end

GETLEN:
        set I0, P1
        print "length="
        print I0
        print "\n"
        ret

it prints:

length=100
P1[0]=0
length=100
P1[10000]=0
length=10001

fetching an element out of bound changes the
length of the array. but should this really happen?
why does perlarray.pmc act like this:

        if (ix >= SELF->cache.int_val) {
            resize_array(interpreter, SELF, ix+1);
        }

instead of:

        if (ix >= SELF->cache.int_val) {
            value = pmc_new(INTERP, enum_class_PerlUndef);
            return value->vtable->get_integer(INTERP, value);
        }

are there any reason for this that I can't see or does it
just need a patch?

cheers,
Aldo

__END__
$_=q,just perl,,s, , another ,,s,$, hacker,,print;


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.