This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-01
Channels
- # announcements (3)
- # babashka (1)
- # beginners (29)
- # calva (3)
- # cider (5)
- # clojure (17)
- # clojure-europe (9)
- # clojurescript (31)
- # conjure (2)
- # cursive (14)
- # datomic (51)
- # deps-new (4)
- # honeysql (8)
- # introduce-yourself (1)
- # lumo (8)
- # malli (28)
- # missionary (1)
- # off-topic (20)
- # pathom (2)
- # polylith (22)
- # practicalli (10)
- # reagent (3)
- # reitit (6)
- # ring (2)
- # schema (2)
- # shadow-cljs (25)
- # spacemacs (3)
is there a function/trick that will fully-qualify a form's symbols according to (ns-aliases *ns*)
? and (ns-interns *ns*)
e.g.
(f '(println)) ;; => '(clojure.core/println)
probably doesn't exist OOTB because for an arbitrary form the answer could be broken (in form of let
shadowing)... it doesn't matter for my use case
ns-resolve
seems handy here
user=> (ns a.b (:require [clojure.string :as str]))
nil
a.b=> (macroexpand-1
(str/lower-case "ABC"))`
(clojure.string/lower-case "ABC")
No need for macroexpand
there - the quoting is processed by the reader.
@U45T93RA6 And I'm not sure you mean by "available at runtime". What's the problem that needs solving?
syntax-quote (as in the snippet above) is a compile-time affordance. I was seeking something I can invoke against unknown inputs
> What's the problem that needs solving? appreciate the intent however in this case I explained quite precisely the problem at hand :)
So instead of println
you actually have something like (def my-symbol 'println)
? Or perhaps that whole quoted form is just a list that's available only in run time.
> Or perhaps that whole quoted form is just a list that's available only in run time. (edited) exactly
Right, seems like you have indeed found your answer then.
And if you do end up needing access to let
bindings, I think you can write a macro that utilizes &env
.
Is there an established naming convention for vars declared with volatile!
, similar to ex. how *a-var*
is common for dynamic vars?
Probably shouldn’t need a convention? The lexical scope of a volatile use should be pretty small and easily seen where it is created and then where it is persisted