in reply to Re: Perl's functional features compared with Ruby
in thread Perl's functional features compared with Ruby

> Built-in support for lists: I think the swap idiom demonstrates that: ( $b, $a ) = ( $a, $b );, though Lisp seems to take this support to an impressive level.

I think here you are falling into a definition trap!

You are showing a Perl list assignment...

But IMHO in LISP-context list mostly means linked list, Perl doesn't support this datatype cause most features can be efficiently mimicked with it's arrays (push, pop, ...).

You may remember that MJD simulated linked lists in his book with chained arrays of two element [$value,$a_ref] where $a_ref always pointing to the next chain link.

One advantage of linked lists over arrays come when splitting them for concurrent processing.

Cheers Rolf

( addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^3: Perl's functional features compared with Ruby
by davido (Cardinal) on Jan 17, 2014 at 17:50 UTC

    It's possible that I don't know what I don't know. ;) ...or that I don't know enough about what "built-in support for lists" means to two different authors coming from different language backgrounds, so you're probably right that I'm falling into a definition trap.

    There are enough fundamental differences between the two languages that paradigms differ, so it's hard to pin down exactly how their features overlap. I suspect that MJD's opinion would differ from Norvig, and I can't hope to bring them together.


    Dave