You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting unexpected "Attempting to call unbound fn" when parsing recursive structure which relies on forward declaration. This is only problem with cold REPL. When I re-evaluate namespace in the REPL for third time it starts working.
I don't understand the underlying issue but it seems to me that my forward-declared var gets somehow baked into some parser(s) and when such parser gets later executed the var is not dynamically resolved but uses value from "compile-time".
Please see this minimal example [1] run py-value does not work in cold REPL, see[2] run py-value2 works, get-py-value2 wrapper is protecting py-value2 from being baked in.
Execution error (IllegalStateException) at blancas.kern.core/>>=$fn (core.clj:377).
Attempting to call unbound fn: #'api-gen.impl.repro/py-value
java.lang.IllegalStateException: Attempting to call unbound fn: #'api-gen.impl.repro/py-value
at clojure.lang.Var$Unbound.throwArity(Var.java:45)
at clojure.lang.AFn.invoke(AFn.java:32)
at blancas.kern.core$_GT__GT__EQ_$fn__1668.invoke(core.clj:377)
at blancas.kern.core$_GT__GT__EQ_$fn__1668.invoke(core.clj:377)
at blancas.kern.core$_LT__BAR__GT_$fn__1665.invoke(core.clj:359)
at blancas.kern.core$_GT__GT__EQ_$fn__1668.invoke(core.clj:377)
at blancas.kern.core$_GT__GT__EQ_$fn__1668.invoke(core.clj:379)
at blancas.kern.core$_GT__GT__EQ_$fn__1668.invoke(core.clj:377)
at blancas.kern.core$_GT__GT__EQ_$fn__1668.invoke(core.clj:377)
at blancas.kern.core$_LT__BAR__GT_$fn__1665.invoke(core.clj:361)
at blancas.kern.core$parse.invokeStatic(core.clj:926)
at blancas.kern.core$parse.invoke(core.clj:917)
at blancas.kern.core$run.invokeStatic(core.clj:956)
at blancas.kern.core$run.invoke(core.clj:949)
at blancas.kern.core$run.invokeStatic(core.clj:953)
at blancas.kern.core$run.invoke(core.clj:949)
at api_gen.impl.repro$eval2217.invokeStatic(repro.clj:35)
at api_gen.impl.repro$eval2217.invoke(repro.clj:35)
at clojure.lang.Compiler.eval(Compiler.java:7177)
at clojure.lang.Compiler.eval(Compiler.java:7132)
at clojure.core$eval.invokeStatic(core.clj:3214)
at clojure.core$eval.invoke(core.clj:3210)
at clojure.main$repl$read_eval_print__9086$fn__9089.invoke(main.clj:437)
at clojure.main$repl$read_eval_print__9086.invoke(main.clj:437)
at clojure.main$repl$fn__9095.invoke(main.clj:458)
at clojure.main$repl.invokeStatic(main.clj:458)
at clojure.main$repl.doInvoke(main.clj:368)
at clojure.lang.RestFn.invoke(RestFn.java:1523)
at nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:79)
at nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:55)
at nrepl.middleware.interruptible_eval$interruptible_eval$fn__940$fn__944.invoke(interruptible_eval.clj:142)
at clojure.lang.AFn.run(AFn.java:22)
at nrepl.middleware.session$session_exec$main_loop__1041$fn__1045.invoke(session.clj:171)
at nrepl.middleware.session$session_exec$main_loop__1041.invoke(session.clj:170)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.lang.Thread.run(Thread.java:830)
The text was updated successfully, but these errors were encountered:
I'm getting unexpected "Attempting to call unbound fn" when parsing recursive structure which relies on forward declaration. This is only problem with cold REPL. When I re-evaluate namespace in the REPL for third time it starts working.
I don't understand the underlying issue but it seems to me that my forward-declared var gets somehow baked into some parser(s) and when such parser gets later executed the var is not dynamically resolved but uses value from "compile-time".
Please see this minimal example [1]
run py-value
does not work in cold REPL, see[2]run py-value2
works,get-py-value2
wrapper is protectingpy-value2
from being baked in.[1]
[2]
The text was updated successfully, but these errors were encountered: