Keep It Simple, Stupid | |
PerlMonks |
Re^2: Does perl6 have a native linked-list data type?by perl5ever (Pilgrim) |
on Nov 17, 2010 at 20:26 UTC ( [id://872050]=note: print w/replies, xml ) | Need Help?? |
Actually, perl is and has been my primary language and I've been using it since the early 90's.
The main difference between a cons cell and an array is that you can get the tail of a cons cell without creating a new data object. The only way to get the tail of an array (as an array) is to create a whole new array object. This difference leads to vastly different algorithms. Cons cells lend themselves to recursive formulations while arrays favor iterative approaches.
In Section
Seekers of Perl Wisdom
|
|