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

  1. It demonstrates Perl's flexibility ¹ and the power of syntactic sugar.

    In other words: Python has no chance to mimic this! (AFAIK)

  2. Technically it's better readable than repeatedly doing stuff like

    my ($c_ref) =@_; $c_ref->(1);

    When using idioms which heavily rely on passing code-blocks it's just a matter of huffman-optimization to abstract the repeated parts away.

    I think you can't "see the use", because Perl doesn't use such idioms as often as Ruby does.

    Without the performance penalty, I'd use it straight away.

    (Keep in mind that many people ignore how slow Ruby is, for the sake of "pretty syntax")

  3. It's a good counter argument for people daemonizing Perl and adoring Ruby.

    I just read the first chapter of "7 Languages in 7 Weeks" which was a funny/shocking experience.

    For instance it praised many features like post-fix if or unless which stem from Perl³ ... just as if Ruby invented it.²

    Why not pirating some of the hype for us?

  4. It shows that an alternative parser for Perl5 could have attracted the audience that Ruby gained.

    Ruby's success is about pretty syntax on Perl semantics. Ruby's success is still heavily shocking the Pythonistas, who believe that Guido is God's (= John von Neumann's?) last prophet.

    (Moose showed how to cover the object model, covering the functional part closes the gap.)

  5. And it demonstrates possibilities to prototype future features w/o ignoring backwards compability.

  6. Last but not least, I already expected you objecting. =)

    But rather about b{ } being superfluous and expensive, while "easily" replaced by sub { } w/o performance loss.

Cheers Rolf

( addicted to the Perl Programming Language)

¹) "I'm every woman, its all in me" - Chaka Khan =)

²) Not talking about the strange and inflationary use of the term DSL within the Ruby community. If there is a mainstream language w/o Lisp's reader macros, which is predestinated to define DSLs, then it must be Perl. (Ok I don't know all maistream languages ... )

³) And are criticized in PBP! =)