Open antonmi opened 3 years ago
Hey guys! Thank you for the great tool! I'm experimenting a bit with multiple decorators like:
@decorate foo() @decorate bar() @decorate baz() def hello() do :world end
Intuitively I expect baz to decorate hello, then bar decorates baz and hello, then, finally foo decorates all of them bar, baz, hello.
baz
hello
bar
baz and hello
foo
bar, baz, hello
But for some reason, there is Enum.reverse here https://github.com/arjan/decorator/blob/7adc22fe6b8a7865ec461d850e3ac735eda33c8d/lib/decorator/decorate.ex#L127 so the execution is the opposite: baz decorates bar, foo, hello.
Enum.reverse
bar, foo, hello
What is the intention of reversing the order? And do you recommend applying several decorators? Thank you!
Hey guys! Thank you for the great tool! I'm experimenting a bit with multiple decorators like:
Intuitively I expect
baz
to decoratehello
, thenbar
decoratesbaz and hello
, then, finallyfoo
decorates all of thembar, baz, hello
.But for some reason, there is
Enum.reverse
here https://github.com/arjan/decorator/blob/7adc22fe6b8a7865ec461d850e3ac735eda33c8d/lib/decorator/decorate.ex#L127 so the execution is the opposite:baz
decoratesbar, foo, hello
.What is the intention of reversing the order? And do you recommend applying several decorators? Thank you!