sci 2025-08-27

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?

โœ… 1

the backtrace this particular time looks like this:

Have you upgraded to the newest SCI?

oh probably not, let me do that

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)

๐Ÿ‘ 1

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?

cool!

โค๏ธ 1

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 :bindings

being non-vars

maybe ... but the error is about symbols, not strings

so this is happening when sci prints a stack trace

๐Ÿ‘ 1

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 object

oh 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)

๐Ÿ‘ 1