I propose that the static func bar part should instead be
static func bar():
var tmp = load("res://REPL.gd")
tmp.foo()
return tmp.foo()
We already optimize self-load on non-static methods by making an instance variable (see #30). It makes sense to do it in the static case as well with a local variable.
If we reference the enclosing class in a static method, we may load the class several times.
This compiles to
I propose that the
static func bar
part should instead beWe already optimize self-
load
on non-static methods by making an instance variable (see #30). It makes sense to do it in the static case as well with a local variable.