Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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?
[stevieb]: perldigious: video near our hq in Montreal. Here in Calgary, it's -28c... we've only got 3" of snow so far, but there are several feet in the mountains already
[perldigious]: Snowshoeing time stevieb? I need to buy a pair so I can walk my German Shepherd properly through the country.
[stevieb]: yeah, I snowshoe a fair amount in the mountains. I also use spikes similar to these very often as well
[perldigious]: Discipulus: alternate link
[stevieb]: LOL you can easily replace "Helsinki" with "Alberta"
[perldigious]: I used to live at the top of a very steep hill stevieb, I can relate to the video. Literally used to have to build up momentum and try to force my vehicle to make it up the hill to park in my driveway properly... didn't always make it.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2016-12-06 16:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (112 votes). Check out past polls.