--- Luke Palmer <[EMAIL PROTECTED]> wrote:
> Joe Wilson writes:
> > Dan Sugalski:
> > > 2) Parrot's Array and SArray values all accept mixed-type data, which 
> > > perl's arrays do *not* do, and as such have some extra speed hits 
> > > that perl arrays don't.
> > 
> > What do you mean?
> > Perl's arrays do indeed accept mixed data types (see example below).
> 
> No, they don't.  They are arrays of PerlScalars only.

I assumed Dan meant strings, floats and integers were mixed data types
because this is what my benchmark programs demonstrated.

That crazy english language. Leave out a word and it changes the meaning
of a sentence. ;-)

> 
> For this:
> 
>     set P1, P0[35]
> 
> The current Array and SArray have to sift through the sparse table to
> find the 35th index (that's pretty efficient, but it still needs to
> check whether it needs to do that).  It then checks whether the 35th
> element is indeed a PMC (it could be an int, num, or str), and then sets
> P1 to that element.  
> 
> Perl's array doesn't have sparse handling (the timing of 
> perl -le '$x[10000000] = 1' should convince you of this), and it doesn't
> need to check whether the 35th element is a scalar, because the only
> thing it holds are scalars.
> 
> Luke



__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

Reply via email to