Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Strange given/when deparsing

by ikegami (Patriarch)
on Jun 09, 2009 at 16:12 UTC ( [id://769981]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Strange given/when deparsing
in thread Strange given/when deparsing

It might have been. It might be. It won't be.

Update: Is the following clearer?

It might have been commutative in the past. It might be commutative now. It won't be commutative in the future.

Replies are listed 'Best First'.
Re^4: Strange given/when deparsing
by akho (Hermit) on Jun 09, 2009 at 16:41 UTC
    I fail to parse your answer. Maybe that's because English is not my first language.

    perlsyn says:

    It is always commutative, i.e. $a ~~ $b behaves the same as $b ~~ $a .
    Do you mean that this behavior is going to change?
      Yes, it won't be commutative in a future release. At least not in general. Some matches will work regardless of the order, but not all.
        Yes, Perl 6 gave whiplash to Perl 5 here; originally it was defined symmetrically, but we broke that after we realized it was silly to define a switch that was impossible to optimize to a jump table even if all the "when" values are small integers. The right side of a smart match is now always considered a pattern that makes its own decision how to match the left side, and it might or might not pay attention to the type of the left side to do so. In Perl 6, integer patterns always do integer comparison, and string patterns always do string comparison, regardless of the structure of the left side.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-19 13:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found