Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^15: Ovid's take on the renaming of "Perl6" (updated)

by Jenda (Abbot)
on Sep 09, 2019 at 01:49 UTC ( [id://11105849]=note: print w/replies, xml ) Need Help??


in reply to Re^14: Ovid's take on the renaming of "Perl6" (updated)
in thread Ovid's take on the renaming of "Perl6"

Better code WHAT? You mean the insanity with Yeyeieieield? A confusing special syntax for methods taking just one lambda (sorry, code block) while the syntax in case you dare to need to pass two is totally different and even more confusing?

Jenda
1984 was supposed to be a warning,
not a manual!

  • Comment on Re^15: Ovid's take on the renaming of "Perl6" (updated)

Replies are listed 'Best First'.
Re^16: Ovid's take on the renaming of "Perl6" (updated)
by Anonymous Monk on Sep 09, 2019 at 06:43 UTC
    Perl has the prototype (&) for code blocks but only as first argument. The rest of your rant is cryptic for me. - lanx

      Prototypes are best ignored.

      In Ruby, if you only need to pass one function/lambda/block/whatever-you-decide-to-call-it, you do NOT specify the function parameter in the method signature, you just happen to use the misnamed, absolutely illogical statement yield (or whatever concoction of vowels that word contains). There is no indication whatsoever in the signature that a block will be accepted as an unmentioned, unnamed parameter.

      As the parameter has got no name, you can't do something like testing it for null or undef, something that'd be in any way consistent with anything. Nope. You test the value of the block_given? method. How lovely.

      Now if you need to pass two lambdas ... you can throw all this down the drain and start again with a named parameter &whatever, call it with whatever.call. How do you specify the hailed blocks when calling that method I can't remember. What I do remember was that if you copied a block from one place to another, suddenly what used to introduce a new variable, lexical to the block, happily accesses a more global variable, 'cause variable declaration is too uncool and you are supposed to have a gazillion of two line methods anyway.

      Yes, you guess right. I had to use Ruby for some time and I hated every single minute.

      Jenda
      1984 was supposed to be a warning,
      not a manual!

        I think what LanX means when saying "prototypes" are formal subroutine parameters, like what Function::Parameters provides and what maybe becomes part of Perl 5.34, not what Perl currently implements under the name uf "prototypes".

        One of the main selling points of Ruby are Domain Specific Languages.

        Restricting Perl to have a code block prototype (&) only at first position is hindering many options for syntactic sugar.

        Be it more expressive versions of 'map' and 'grep' or 'loop' constructs. Basically because you want to add a modifier between keyword and block, without needing to explicitly introduce ', sub' .

        Your rant about the limits of Ruby may be legit, but had little or nothing to do with what I said or meant.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11105849]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 18:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found