i keep getting this error in various places:
java.lang.IllegalArgumentException: No implementation of method: :getName of protocol: #'sci.impl.types/HasName found for class: clojure.lang.Symbol
do you recognize it? should i make a small reproduction?the backtrace this particular time looks like this:
Have you upgraded to the newest SCI?
oh probably not, let me do that
i'm on https://github.com/babashka/sci/tree/56104c81cb7a3804f8ee84aa64b313dc7143f30e
repro welcome. this probably results from (binding [*ns* 'foobar]) so binding *ns* to a symbol rather than a namespace object (both should work I think but maybe not currently in SCI)
hold on my own code is a mess ๐ let me try to reproduce this at all before i minimize it
just curious, what are you building with SCI, if you want to share?
and you will probably be interested in <https://codeberg.org/jyn514/flower/#why-clojure>
cool!
FYI i haven't forgotten about this but SCI 10.49 breaks my code in different ways so i am holding off on updating until i minimize the bug
you're looking for a minimal repro right?
yeah, flower is like 2k lines of clojure and guessing and checking won't help anything haha
not counting the runtime code it's interpreting
Perhaps it has to do with:
'ยซ "ยซ"
'ยป "ยป"
'โ "โ"
in :bindingsbeing non-vars
maybe ... but the error is about symbols, not strings
right
so this is happening when sci prints a stack trace
mhm, the bit i have to reproduce is the stacktrace that crashes it
i was not being careful with my git state
not all stacktraces are broken, most of them print fine
it's happening in the call to sci/stacktrace that's for sure
you could try this:
(defn clean-ns [m]
(if-let [ns (:ns m)]
(do
(prn :ns ns)
(assoc m :ns (sci-ns-name ns)))
m))
(alter-var-root #'sci.impl.callstack/clean-ns (constantly clean-ns))
Then it will print the :ns value that is a symbol here rather than the namespace objectoh cool, and that will help me minimize it ๐ thanks!
that prints :ns clojure.core
(reproduced this completely by accident while doing something different, lol, but i have enough to minimize now)
ohhhh you know what, i'm doing with things with clojure.core because i wanted to copy things that were only available in a later version of clojure than SCI supports
yeahhhh ok, so when i call sci/copy-var*, i call it on the symbol 'clojure.core, not a namespace i created with create-ns
and that fixed it
tysm !!! i would never have thought of changing clean-ns haha
also the repro in the guest code was to refer to an unbound name inside of clojure.core/comp, e.g. (comp first not-a-real-var)