More D newb questions.

Me Here p9e883002 at sneakemail.com
Thu May 8 03:15:09 PDT 2008


Pontus Pihlgren wrote:

> probably only meaningful in Perl   where
> arrays really are linked lists.

Not quite. Perl's arrays are actually bog standard C style arrays (of pointers
to SV*s).
Plus a header and some logic: 

http://www.perl.org/tpc/1998/Perl_Language_and_Modules/Perl%20Illustrated/av.gif

The guts of an array is a contiguos allocation of size * 4 bytes. 
Their power & flexibility comes completely from the syntax 
and core code that implements it.
Their relative efficiency comes from the use of two pointers,
and length field and two flag bits in teh header.

> 
> Regards,
> Pontus.

Cheers, b.

-- 




More information about the Digitalmars-d mailing list