Closed arrdem closed 8 years ago
@Bronsa points out that, as presently implemented, calling withMeta
on AFn
will return a new anonymous AFn
which masks all methods and uses applyTo
for everything. This means that putting metadata on the Fn
itself is a pretty crappy idea until fn*
emission can be fixed to implement withMeta
itself.
This is doable, in fact it should be a pretty simple copy/paste job from the implementation of reify*
which must implement IObj
in the code generator. However I'm seeing weird shit and think I may have broken AOT somehow so I'm gonna circle back to this another day.
This changeset tweaks the compiler to emit introspectable Var use set and arity information on Fns.
At present, a Fn can have the following metadata:
:uses
, the set of Vars directly used by this FnOther metadata may be added in the future given more consideration.
Fixes #127
Thanks to @mikera for some prior art on this matter, and RFC on this implementation.