babashka 2026-07-30

isn't clojure.core/Inst supported?

(extend-protocol Inst
  Long
  (inst-ms* [inst] inst))
Type:     clojure.lang.ExceptionInfo
Message:  Protocol not found: Inst

Works for me in a plain REPL:

> clj
Clojure 1.13.0-alpha6
(extend-protocol Inst
  Long
  (inst-ms* [inst] inst))
nil
user=>

Oh, you mean in Babashka.

👍 1

yes, in babashka

Since Inst is a protocol and not an interface I think I could fix that. Would you mind posting an issue?

👍 1

I found this existing issue, I believe it is the same thing https://github.com/babashka/babashka/issues/1321

@marcobiscaro2112 I have a prototype of this laying around to fix the problem. Can you tell more about the use case? After extending Inst, what should work? A fuller example would be cool

the context is this https://github.com/cognitect-labs/aws-api/issues/314. tl;dr: aws-api claims to support values that conform to inst?, but only actually supports java.util.Date. so, I changed the implementation https://github.com/cognitect-labs/aws-api/pull/315, and the new test failed in babashka. > After extending Inst, what should work? I would expect inst? and inst-ms to work with the extended type, and the spec predicate and formatting will work as expected

does that answer your question?

yep, if you just need inst? and inst-ms to work with Date, then I have enough info to make that work through extend/etc

🎉 1