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

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

by pokki (Monk)
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

Replies are listed 'Best First'.
Re^4: RFC: Simulating Python's @decorators in Perl with Attributes
by LanX (Bishop) 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?
[corenth]: Good morning (in my neck of the woods)
[Cosmic37]: hello perly kings and queens
[jedikaiti]: 'ello Monks
[Cosmic37]: and monkeys too...
[Cosmic37]: is anyone doing machine learning with Perl?
[Cosmic37]: I was using gneural code in C and it was interesting but did not have back propagation for neural networks
[corenth]: Cosmic, poking at it, but not really.
[Cosmic37]: I read that its possible to use the FANN library with Perl so I might try that now...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2018-02-20 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (274 votes). Check out past polls.

    Notices?