I believe the passage you're referring to from Higher Order Perl is this one:

If you pick up a good book about Lisp, there will be a section that describes Lisp's good features. For example, the book Paradigms of Artificial Intelligence Programming, by Peter Norvig, includes a section titled What Makes Lisp Different? that describes seven features of Lisp. Perl shares six of these features; C shares none of them. There are big, important features, features like first-class functions, dynamic access to the symbol table, and automatic storage management. Lisp programmers have been using these features since 1957. They know a lot about how to use these language features in powerful ways. If Perl programmers can find out the things that Lisp programmers already know, they will learn a lot of things that will make their Perl programming jobs easier.

In that passage MJD mentions seven features of Lisp. He enumerates three of them as "big" features:

I don't know Ruby, so I would have to ask someone who does (and it sounds like you've spent more time with it than I have): Does Ruby have First Class Functions? The table on the Wikipedia page to which I linked seems to indicate that Ruby's semantics don't provide as much flexibility in this regard as Perl.

The next one is "dynamic access to the symbol table". I'm hesitant to say that Ruby doesn't provide full access to the symbol table, but this StackOverflow answer seems to indicate that there is a certain degree of introspection available, and I believe there's an equivalent to symbolic references in Ruby. I don't know if it rises to the level of flexibility (and danger) that Perl provides, but it might, and someone who knows Ruby better could say for sure.

The last one is automatic storage management. Perl is a reference counting language. So is Ruby. Both will have the potential for trouble with circular references.

At one point I was interested in what the other categories were, so I looked for the book that MJD refers to. Here's the list, copied word for word from the book:

(The list is actually eight, including History.)

Uniform Syntax was interesting to me. I found this article from drdobbs that demonstrated what that refers to, and guess what? Perl has that (it's how we do objects).

Dynamic typing is a no-brainer; of course Perl has dynamic typing. 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. Interactive environment? Well, not like Lisp, but we do have Repl's available. ...but not like Lisp, and I doubt there are many languages that do it to the degree that Lisp does. Extensability: We have the ability to pull in modules and classes. Modules can have their own namespaces, or they can infect other namespaces if we want them to. We have XS. Perl is pretty extensible, but Lisp is designed such that extensibility is the only way to actually accomplish anything. A Lisp program is the art of manipulating the syntax tree. Perl possesses some of the extensibility features, but again Lisp is on a whole different level.

As for history, it's hard to compete with a language that's been around since the 50's.

So now that you have the complete list, you can do your research and report back to us on how Ruby fares against Lisp, and against Perl's Lispy strengths.


Dave


In reply to Re: Perl's functional features compared with Ruby by davido
in thread Perl's functional features compared with Ruby by gunzip

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.