Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: The reason for the "yada yada" operator

by chromatic (Archbishop)
on Jul 11, 2013 at 16:22 UTC ( [id://1043772]=note: print w/replies, xml ) Need Help??


in reply to The reason for the "yada yada" operator

It's shorter and reads better, which is an argument for a lot of things in Perl, including say.

It's not overloading the range or flip/flop operator in the grammar sense, because there was no syntactic construct in the Perl 5 grammar for ... as a term or nullary operator.

Replies are listed 'Best First'.
Re^2: The reason for the "yada yada" operator
by tobyink (Canon) on Jul 11, 2013 at 16:28 UTC

    Also, there were already gazillions of examples in documentation like:

    if (frobnicate(42)) { ... }

    Implementation of the yada-yada operator made them all syntactically correct. :-)

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Re^2: The reason for the "yada yada" operator
by sundarurfriend (Novice) on Jul 11, 2013 at 17:13 UTC
    > It's shorter and reads better

    The "reads better" part is hugely subjective though, and in my opinion ... only obfuscates thing a bit. die 'Unimplemented' is self-documenting, can be read out aloud, and it's immediately obvious what it does, whereas ... just looks pretty and cool (IMHO of course).

    > It's not overloading the range or flip/flop operator in the grammar sense

    It still overloads the actual sequence of characters ..., which is a mental burden, and IMO unnecessary for such a miniscule benefit. Perl developers are used to the scalar/list context distinction between range and flip-flop operation, but this introduces new behavior in yet another context for pretty flimsy reasons.

      The "reads better" part is hugely subjective though...

      Maybe, but as tobyink reminded me, it was already an implicit operator in plenty of documentation, which all of a sudden started to compile correctly.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-03-28 20:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found