Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by pokki (Scribe)
on May 28, 2013 at 19:54 UTC ( #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
Re^4: RFC: Simulating Python's @decorators in Perl with Attributes
by LanX (Canon) 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
Node Status?
node history
Node Type: note [id://1035711]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2014-09-22 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls