clojure-europe

nnecklace 2026-06-04T07:48:50.230179Z

good morning β˜€οΈ

thomas 2026-06-04T08:29:10.248219Z

mogge

mdiin 2026-06-04T08:56:05.551289Z

Godmorgen

plexus 2026-06-04T08:59:06.341389Z

definitely up there in terms of confusing clojure error messages

class my.ns$some_var cannot be cast to class clojure.lang.IFn$LLO

πŸ€” 1
plexus 2026-06-04T09:00:07.813429Z

my (potentially wrong) understanding is that I had a var with primitive tags on the arguments, which I changed and re-evaluated, but I did not re-evaluate the place where it's being called

Allan GonΓ§alves 2026-06-04T09:14:40.878609Z

I really appreciate the work Sean has been doing on https://clojurians.slack.com/archives/C06MAR553/p1779243752566019

πŸ‘πŸ» 1
plexus 2026-06-04T09:16:30.424369Z

Yeah I need to make some time to try that out, maybe we'll add it as a default to launchpad

seancorfield 2026-06-04T12:32:57.472109Z

I look forward to any and all feedback on rephrase...

plexus 2026-06-04T13:13:37.176019Z

here's a repro @seancorfield, unless I'm holding it wrong it doesn't seem like rephrase does anything with this one yet

(defn foo ^long [^long x]
  x)

(defn bar []
  (+ (foo 3) (foo 4)))

(bar)

(defn foo [x] x)

(bar) ;;=> throws: class repl_sessions.rephrase_test$foo cannot be cast to class  clojure.lang.IFn$LL

seancorfield 2026-06-04T13:16:14.757029Z

I get "Expected a function$LL, but was given user$foo, at user/bar (REPL:1) - runtime error (unexpected type)." You added wrap-rephrase as nREPL middleware when starting your REPL?

seancorfield 2026-06-04T13:16:47.409649Z

(which can definitely be improved, but does show it working)

plexus 2026-06-04T13:22:48.453089Z

I did, although it may be interacting with some custom middleware we have...

seancorfield 2026-06-04T13:23:44.151229Z

And how are you eval'ing the code? I did it in a plain nREPL client but it also works for me, eval'ing forms via VS Code/Calva.

plexus 2026-06-04T13:25:26.399949Z

from emacs/cider. don't worry about it, it's almost certainly something weird in my setup

seancorfield 2026-06-04T13:27:11.477769Z

If it helps, here's how I construct my list of middleware: https://github.com/seancorfield/dot-clojure/blob/develop/src/org/corfield/dev/repl.clj#L164-L170 nREPL does a topo sort on metadata (requires/expects) so order should not matter (in theory).

neumann 2026-06-04T16:40:39.767479Z

@plexus Would you mind filing an Ask Clojure about this error? It would help the dev team to have specific examples of bad errors. This error seems especially lousy!

plexus 2026-06-05T08:04:15.106479Z

@neumann there you go https://ask.clojure.org/index.php/15124/changing-type-tags-can-lead-to-cryptic-errors not a question though so doesn't feel right to post it there, but since you asked.

neumann 2026-06-05T16:49:39.335679Z

It's definitely appropriate to post there. In fact, @alexmiller suggested it to me. If it makes you feel better, the implied question is, "Can you please fix this?" πŸ™‚

Alex Miller (Clojure team) 2026-06-05T18:45:38.893249Z

I will eventually get around to replying better there, but this error doesn't really surprise me, good example of the general problem of "repl state contains only partially recompiled code". also a good example of a case that more defensive code could detect and either error better or literally handle automatically by finding the primitive interface no longer exists and choosing the non-primitive invoke (which still exists). However, the tradeoff is that every call-site is way more code. I think we'd all take the tradeoff of better errors at repl/dev time, but most would not like it at prod time where there are real costs (what if all classes were 10-20% bigger and thus harder for the jit to optimize?). We've been thinking about dev vs prod compilation modes for at least a decade as it would let us take both sides. I spent some time working on it within the last year, still an active idea! It's great to have more examples like this.

πŸ™ŒπŸ» 1
neumann 2026-06-05T19:34:45.299249Z

Just to be clear, @alexmiller, your comment "this error doesn't really surprise me". I'm assuming you mean that as someone who understand the compiler internals quite well. As a user, it is quite surprising, so if I can speak for you, I'd say that you're not negating the validity of that experience. I'd love to see a dev mode that would provide high-quality error messages, even if the code was less efficient. I might even leave that flag on for code that wasn't performance sensitive.

Alex Miller (Clojure team) 2026-06-05T20:11:06.891309Z

yes, I meant to me, not to user, sorry if that was unclear. Agree this is inscrutable to user

Rachel Westmacott 2026-06-04T09:25:09.778439Z

good mornings!

imre 2026-06-04T11:55:17.134369Z

good morning

neumann 2026-06-04T16:40:57.752529Z

Good morning!

πŸ‘‹ 3
daveliepmann 2026-06-04T18:04:23.381469Z

Hearty good morning this fine Thursday

❀️ 1
ray 2026-06-04T20:38:57.820489Z

I'm more proficient at stringing than playing 😬

seancorfield 2026-06-04T21:04:49.529279Z

I'm sure you're more proficient at playing than I am πŸ™‚

ray 2026-06-04T21:06:52.624949Z

πŸ€·πŸ»β€β™‚οΈ

Patrick 2026-06-04T22:09:10.744309Z

good morning

ray 2026-06-04T20:37:15.431829Z

Good str/trim morning

🎸 1
yannvahalewyn 2026-06-05T18:54:08.112109Z

That guitar looks gorgeous!

πŸ™πŸΌ 1
ray 2026-06-05T18:56:09.756699Z

It's better looking than I am at playing

yannvahalewyn 2026-06-05T18:58:27.883029Z

I don't about that but I know it’s not better looking than you πŸ˜‰

ray 2026-06-05T19:19:50.196409Z

Ha, you're too kind 😊