Fork me on GitHub
#joker
<
2020-04-28
>
borkdude10:04:34

oh, I see it's not not .cljc but it can be made so.

myguidingstar10:04:42

actually porting spec to joker is the reason why I asked that demungequestion 😄

myguidingstar10:04:13

joker is currently the only unofficial variant of Clojure that supports namespace and qualified keywords (in comparison to janet, ferret)

borkdude15:04:22

babashka has them too. If you want to co-operate on the existing work that I already have - it's only a few tweaks to make it work with joker probably

myguidingstar16:04:35

I consider babashka a repackaging version of Clojure JVM ;)

borkdude17:04:12

That's kind of true, but also not. https://github.com/borkdude/sci is a Clojure interpreter backing it all up

myguidingstar16:04:03

regarding spartan.spec, I think the remaining tweak is that demunge/ fn-sym functions

👍 4
myguidingstar16:04:05

so what you joker developers think about adding that ability?

4
jcburley21:04:38

It’s an interesting question! Joker is well-designed and fairly easily changed to accommodate such things IME, but I don’t think I have a solid grasp on the issues around naming Fn objects in some fashion.

jcburley21:04:58

I’m guessing that Clojure gives them name info because it has to, insofar as a new function must be compiled via the Java machinery, which requires a name. E.g. see:

user=> (let [a (fn [] (+ 3 3))] (println a))
#object[user$eval142$a__143 0x6e6fce47 [email protected]]
nil
user=>

jcburley21:04:51

Joker, OTOH, just interprets them on the fly, so any naming needn’t be “pushed down” into the Fn objects themselves. I.e. an Fn doesn’t need a name because it isn’t handed off to a compiler.

jcburley21:04:52

So while Clojure has to “invent” a name for an (fn ...) outside of a (defn …), in order to compile it, Joker needn’t do that, so…it doesn’t, keeping things simple.

jcburley21:04:18

(My guess might be wrong or incomplete, of course!)

jcburley21:04:42

What, if anything, does the corresponding Spec stuff do with this case (which I forgot to “Also send to #joker” earlier in this thread)?

user=> (let [a (fn [] (+ 3 3))] (println a))
#object[user$eval142$a__143 0x6e6fce47 [email protected]]
nil
user=>

jcburley21:04:56

In particular, I don’t understand why anything would need to know the namespace in which an arbitrary (fn …) appeared, such that Joker (or any other Clojure clone that is an interpreter) would need to attach namespace info, nevermind some name to it.

jcburley21:04:38

It’s an interesting question! Joker is well-designed and fairly easily changed to accommodate such things IME, but I don’t think I have a solid grasp on the issues around naming Fn objects in some fashion.

jcburley21:04:51

Joker, OTOH, just interprets them on the fly, so any naming needn’t be “pushed down” into the Fn objects themselves. I.e. an Fn doesn’t need a name because it isn’t handed off to a compiler.

jcburley21:04:52

So while Clojure has to “invent” a name for an (fn ...) outside of a (defn …), in order to compile it, Joker needn’t do that, so…it doesn’t, keeping things simple.

jcburley21:04:18

(My guess might be wrong or incomplete, of course!)

jcburley21:04:42

What, if anything, does the corresponding Spec stuff do with this case (which I forgot to “Also send to #joker” earlier in this thread)?

user=> (let [a (fn [] (+ 3 3))] (println a))
#object[user$eval142$a__143 0x6e6fce47 [email protected]]
nil
user=>

jcburley21:04:56

In particular, I don’t understand why anything would need to know the namespace in which an arbitrary (fn …) appeared, such that Joker (or any other Clojure clone that is an interpreter) would need to attach namespace info, nevermind some name to it.