Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: The reason for the "yada yada" operator

by chromatic (Archbishop)
on Jul 11, 2013 at 16:22 UTC ( #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 (Abbot) 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
Node Status?
node history
Node Type: note [id://1043772]
help
Chatterbox?
[marto]: Hey Corion, how are things?
[Corion]: Fine! It's amazing how productive I can be with a 3hour daily workload removed :)
[Corion]: My to-do emails level is at a 12-months-low of 21 , from 36 last week ;)
[marto]: I'm recovering from a bad day yesterday, on most counts :P
[Corion]: Also , I made great progress in actually writing the automation script that will run large parts of the 3hour workload now, largely by discussing what error conditions need to be handled by manual intervention and reducing these :)
[Corion]: marto: Ow! What was so bad about yesterday?

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2018-05-24 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?