Closed trusktr closed 5 months ago
No, decorators are intended to be declarative and apply only once during declaration instantiation. Extractors are intended to be evaluated as part of normal evaluation, such as during any function call or during each successive iteration of a for
loop.
For example,
class C {
m(@Foo x) { }
}
would run once when C
is defined, and could be used to describe metadata about the x
parameter of C
's m
method.
However,
class C {
m(Foo(x, y)) { }
}
would run every type m
is called as part of destructuring the first argument.
or similar, leaving the implementation to decorator authors (perhaps also providing decorator primitives for authors to use)?