sci

jyn 2025-08-27T17:38:11.974809Z

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
jyn 2025-08-27T17:39:04.296319Z

the backtrace this particular time looks like this:

borkdude 2025-08-27T17:52:49.892109Z

Have you upgraded to the newest SCI?

jyn 2025-08-27T17:53:11.327829Z

oh probably not, let me do that

borkdude 2025-08-27T17:53:59.878869Z

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
jyn 2025-08-27T17:55:30.897739Z

hold on my own code is a mess ๐Ÿ˜… let me try to reproduce this at all before i minimize it

borkdude 2025-08-27T17:56:07.421779Z

just curious, what are you building with SCI, if you want to share?

jyn 2025-08-27T17:56:58.498109Z

https://codeberg.org/jyn514/flower/

jyn 2025-08-27T17:57:15.116949Z

and you will probably be interested in <https://codeberg.org/jyn514/flower/#why-clojure>

borkdude 2025-08-27T17:59:32.622359Z

cool!

โค๏ธ 1
jyn 2025-08-28T17:45:24.296769Z

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

borkdude 2025-08-28T17:45:44.255899Z

you're looking for a minimal repro right?

jyn 2025-08-28T17:46:06.408449Z

yeah, flower is like 2k lines of clojure and guessing and checking won't help anything haha

jyn 2025-08-28T17:46:24.687979Z

not counting the runtime code it's interpreting

borkdude 2025-08-28T17:51:54.089819Z

Perhaps it has to do with:

'ยซ "ยซ"
              'ยป "ยป"
              'โ—Š "โ—Š"
in :bindings

borkdude 2025-08-28T17:51:58.981959Z

being non-vars

jyn 2025-08-28T17:52:20.091699Z

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

borkdude 2025-08-28T17:52:31.301749Z

right

borkdude 2025-08-28T17:52:48.143049Z

so this is happening when sci prints a stack trace

๐Ÿ‘ 1
jyn 2025-08-28T17:53:10.852139Z

mhm, the bit i have to reproduce is the stacktrace that crashes it

jyn 2025-08-28T17:53:14.875579Z

i was not being careful with my git state

jyn 2025-08-28T17:53:55.828539Z

not all stacktraces are broken, most of them print fine

borkdude 2025-08-28T17:59:20.553749Z

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

jyn 2025-08-28T18:00:05.767749Z

oh cool, and that will help me minimize it ๐Ÿ™‚ thanks!

jyn 2025-08-29T00:21:26.382929Z

that prints :ns clojure.core

jyn 2025-08-29T00:21:59.157959Z

(reproduced this completely by accident while doing something different, lol, but i have enough to minimize now)

jyn 2025-08-29T00:22:47.912289Z

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

jyn 2025-08-29T00:26:12.288789Z

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

jyn 2025-08-29T00:27:55.058499Z

and that fixed it

jyn 2025-08-29T00:28:13.232239Z

tysm !!! i would never have thought of changing clean-ns haha

jyn 2025-08-29T00:29:59.076129Z

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