Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: RFC: Simulating Python's @decorators in Perl with Attributes

by pokki (Monk)
on May 28, 2013 at 19:54 UTC ( [id://1035711]=note: print w/replies, xml ) Need Help??


in reply to Re^2: RFC: Simulating Python's @decorators in Perl with Attributes
in thread RFC: Simulating Python's @decorators in Perl with Attributes

All those other uses for attributes are useful and interesting, but I thought we were talking about method decoration?

Decorators as code rather than syntax also allow you to decorate someone else's methods, or to compose some advice into some class through roles, even at runtime. This is not possible with attributes.

  • Comment on Re^3: RFC: Simulating Python's @decorators in Perl with Attributes

Replies are listed 'Best First'.
Re^4: RFC: Simulating Python's @decorators in Perl with Attributes
by LanX (Saint) on May 28, 2013 at 20:20 UTC
    Could it be that you are confusing the meaning of "decorator"?

    The term "decorator" in the Python universe has not much to do with the "decorator pattern".

    see also SO:Whats the difference between Python decorators and Decorator Pattern?

    The initial motivation to look again into Perl attributes was a discussion about Python decorators.

    While Perl attributes are more powerful, they are also more difficult to handle.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2024-04-18 17:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found