This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-27
Channels
- # aws (19)
- # babashka (47)
- # beginners (111)
- # boot (3)
- # bristol-clojurians (3)
- # chlorine-clover (2)
- # cider (13)
- # cljs-dev (8)
- # clojure (143)
- # clojure-europe (11)
- # clojure-germany (10)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-spec (6)
- # clojure-survey (3)
- # clojure-uk (42)
- # clojurescript (229)
- # conjure (131)
- # cursive (21)
- # data-science (18)
- # datomic (4)
- # emacs (21)
- # events (2)
- # figwheel-main (12)
- # fulcro (18)
- # graalvm (1)
- # hoplon (40)
- # jobs (1)
- # joker (17)
- # kaocha (1)
- # lambdaisland (1)
- # off-topic (19)
- # rdf (7)
- # re-frame (31)
- # reagent (26)
- # reitit (20)
- # rum (4)
- # shadow-cljs (106)
- # sql (17)
- # testing (5)
- # vim (2)
Some “fun” news on https://github.com/jcburley/joker`gostd`https://github.com/jcburley/joker: • I pushed some significant changes a week or so ago -- but there’s much to be done, and I’m rethinking how to do that to make (at least portions of) it more palatable for eventual incorporation into official Joker • Last night, I used it to send my first email (via SMTP) -- an entirely empty one, though -- via Joker, as described in https://github.com/jcburley/joker/blob/gostd/GOSTD.md`GOSTD.md`https://github.com/jcburley/joker/blob/gostd/GOSTD.md • It’s looking more and more like this fork has exposed https://stackoverflow.com/questions/61342000/why-might-exec-command-start-hang-on-darwin: some kind of race condition, perhaps? So, while it’s hardly ready for “prime time” and is likely to undergo some substantial changes to its public-facing functionality, it’s still kinda percolating along, and bearing at least a little fruit.
is there anything like clojure.main/demunge
in joker?
what I want is to have a function (not a macro!) that receive a function object and possibly return that object's symbol. Eg (find-the-sym +)
=> joker.core/+
(Okay, it’s pretty freaky watching someone else’s comments get added and deleted LIVE while looking at my Slack window!! I know Slack supports deletion, just hadn’t seen it happen like that before. 😲)
I typed this:
(defn resolved-name [sym]
(when-let [res (resolve sym)]
(let [m (meta res)]
(symbol (str (ns-name (:ns m))) (str (:name m))))))
user=> (resolved-name '+)
joker.core/+
but then removed it as I realized this is not the same as passing the function object.Yeah, I saw it and it was a good attempt, and I understood why you removed it. It was a new experience to me (in a chat channel, versus a shared doc being edited) watching it un-render itself.
Anyway, Fn
in Joker has a MetaHolder
field, but it’s typically nil
. One must have the (var …)
for it to get at the actual metadata. I don’t know offhand whether it’s feasible for Joker to put something helpful in the Fn.MetaHolder
field, nor what exactly Clojure is doing here.
One of the changes I made, to support faster initialization, was to “decorate” built-in (`Proc`) functions so they show their own names. E.g.:
user=> cons
#object[Proc:procCons]
Possibly Joker could, a la Clojure, return more info than just #object[Fn]
when stringizing a function. From there, a joker.repl/demunge
function might be worth creating? Not sure offhand re the use cases for any of this though…maybe someone could Issue this and explain?
I know one use case in clojure spec where they try to reverse engineer a printed spec message from a function name. Let me look it up.
Not in and of itself, and Joker doesn’t (yet) support Spec, but isn’t Specize
’s Object
(which calls fn-sym
) public?
yes, but their implementation is probably relying on something that the community should not use - maybe. worth asking in #clojure
btw, I have a version of spec that runs with babashka. https://github.com/borkdude/spartan.spec
it is .cljc. I'm open to receiving PRs to make it compatible with joker via a :joker
conditional.