in reply to Re: RFC: Simulating Ruby's "yield" and "blocks" in Perl
in thread RFC: Simulating Ruby's "yield" and "blocks" in Perl

> (on the interpreter-level - not via (sorry) ugly hacks like your "yield").

Backwards compatibility is always an issue when discussing new features.

Ugly hacks which work (even slowly) for old Perl versions improve the acceptance of new features.

And normally the "ugliness" would be hidden in a module, much like the code of the Perl interpreter isn't judged for prettiness.


> Are languages like Perl, Python, Ruby, Javascript not all "essentially" the same?


Just to make it measurable:

The efforts needed for an experienced Perl programmer to learn Python are at least 10 times bigger than for Ruby.

It's because Ruby copied semantics and even names for operators and idioms deep into details. Old docs for Ruby still mentioned the strong Perl heritage.

And you might notice that a "ruby" is a gem and not a snake.

AFAIK the semantic influence of Python is basically the exception system.


To give a concrete example, the equivalent for an anonymous sub in Perl or a {block} in Ruby is a lamda in Python. But a lamda is restricted to at most one statement, with the effect that some functional idioms in Python look like a cluttered mess of nested lambdas.


Furthermore Python doesn't have variable interpolation in strings, you must use printf or similar replacement techniques.

Cheers Rolf

( addicted to the Perl Programming Language)

Comment on Re^2: RFC: Simulating Ruby's "yield" and "blocks" in Perl
Select or Download Code