(defn example () 3)
(defn foo ()
(new (Reference)
(defn bar (y) (lambda (x) (example)))))
The lambda inside the lambda class does not correctly inherit the outer class reference needed to access example. That's because, as far as GDLisp is concerned, example is a global function requiring no closure. But on the GDScript side, we synthetically generated an outer class ref inside new to get the right behavior, so that name does need to be closed around in some form (or simply recreated) to be able to access example.
The lambda inside the lambda class does not correctly inherit the outer class reference needed to access
example
. That's because, as far as GDLisp is concerned,example
is a global function requiring no closure. But on the GDScript side, we synthetically generated an outer class ref insidenew
to get the right behavior, so that name does need to be closed around in some form (or simply recreated) to be able to accessexample
.