Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: A "but" operator.

by TimToady (Parson)
on Sep 27, 2004 at 19:01 UTC ( #394298=note: print w/ replies, xml ) Need Help??


in reply to Re: A "but" operator.
in thread A "but" operator.

The but operator in Perl 6 is really a mixin operator underneath. Or looking at it the other way around, mixins already have a strong component of "I wish to contradict something someone said earlier".


Comment on Re^2: A "but" operator.
Download Code
Re^3: A "but" operator.
by BrowserUk (Pope) on Sep 27, 2004 at 19:34 UTC

    Something like?

    my Model $T = Ford( color => any( @colors ) ) but 'black';

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      I believe you are thinking of "except". </grammar-nazi>

        No, I'm not.

        Anecdotal history suggests that Henry Ford's sales pitch for the Model T was "you can have any color you like; so long as it's black". </history_nazi> :)

        If I understand TimToady's statement of but being a mixin that allows you to contradict (override) early conditions or restraints, the analogy is that you take the guy's order for his model T, and allow him to specify whatever color he wishes; but you then override that by supplying a black one.


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "Think for yourself!" - Abigail
        "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-12-20 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (97 votes), past polls