Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Why isn't ->can() curried? (power)

by tye (Sage)
on Jan 20, 2003 at 18:21 UTC ( #228429=note: print w/replies, xml ) Need Help??

in reply to Why isn't ->can() curried?

Because that would be less powerful and slower. Each call to can() would have to create a closure but, in 90% of the cases, it would be almost immediately destroyed.

With the current implementation you can get what you want rather easily. [ This is shown elsewhere in this thead, but please don't override UNIVERSAL::can() as you'll just break other code in some module that is used by some module... that you used. Instead, provide that functionality via a different method name. ] But if your implementation were the default then there would be no easy way to get the current information.

It would no longer work to say     $o1->can($m) == $o2->can($m) to see if two objects are using the same implementation of a method, for example.

                - tye

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2021-03-04 19:28 GMT
Find Nodes?
    Voting Booth?
    My favorite kind of desktop background is:

    Results (107 votes). Check out past polls.