in reply to Perl's functional features compared with Ruby

I don't feel qualified for an in depth discussion of Ruby, some snippets I heard for further discussions.

  1. Ruby (like Python) doesn't declare variables like Perl does with my or JS with var

    Variables are implicitly declared by first initialization. This leads to ambiguities if you try to assign to a closed over variable. (and sabotages any attempt to realize strict)

  2. Ruby has (had?) problems with blocks in blocks.

    IIRC it wasn't clear if a closed over variable belonged to the top or the middle scope. This lead to changes between different versions and therefore to incompatibilities.

  3. Ruby has some syntactic sugar in FP where Perl needs more syntax.

    refer to RFC: Simulating Ruby's "yield" and "blocks" in Perl as an example.

    or compare lamdas in Perl { my ($x,$y) = @_; ... } and Ruby  { | x,y |  ... }

  4. Ruby and Perl are on a semantic level barely different.

    Quoting Guido: "From a 10 km above perspective Python, Perl and Ruby are the same language".

    I'd like to add from a 10 m perspective this already applies to Perl and Ruby!

    Matz based Ruby mostly on Perl attempting a more pleasant syntax and later spending much time denying it.

    This includes FP!

Maybe stackoverflow is a better place to ask and attract more polyglot crowd for in detail analysis.

Cheers Rolf

( addicted to the Perl Programming Language)