public class <magic>foo$<fn>__17 : AFunction
{
internal static Var clojure_core$inc;
internal object a;
static <magic>foo$<fn>__17()
{
<magic>foo$<fn>__17.clojure_core$inc = RT.var("clojure.core", "inc");
}
public override object invoke()
{
return ((IFn)<magic>foo$<fn>__17.clojure_core$inc.getRawRoot()).invoke(this.a);
}
}
public class <magic>foo$xx__18 : AFunction
{
internal static Var clojure_core$inc; // <== should not be here
static <magic>foo$xx__18()
{
<magic>foo$xx__18.clojure_core$inc = RT.var("clojure.core", "inc");
}
public override IFn invokeTyped(object a)
{
return new <magic>foo$<fn>__17
{
a = a
};
}
public override object invoke(object a)
{
return this.invokeTyped(a);
}
}
The var inc is lifted into the function xx despite the fact that it is only used in its nested function. Lifted keywords are similarly affected. Var and keyword collection should be more like closures.
Right now the following
compiles into
The var
inc
is lifted into the functionxx
despite the fact that it is only used in its nested function. Lifted keywords are similarly affected. Var and keyword collection should be more like closures.