This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-10
Channels
- # beginners (61)
- # boot (264)
- # cider (125)
- # cljs-dev (3)
- # clojure (118)
- # clojure-gamedev (3)
- # clojure-greece (1)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-poland (3)
- # clojure-russia (38)
- # clojure-spain (2)
- # clojure-spec (17)
- # clojure-taiwan (1)
- # clojure-uk (42)
- # clojurescript (118)
- # clojutre (5)
- # cursive (24)
- # datomic (22)
- # emacs (3)
- # events (2)
- # figwheel (19)
- # funcool (1)
- # jobs-discuss (224)
- # jobs-rus (1)
- # klipse (14)
- # luminus (1)
- # lumo (49)
- # off-topic (51)
- # om (34)
- # pedestal (1)
- # perun (1)
- # planck (93)
- # powderkeg (1)
- # re-frame (15)
- # ring (4)
- # rum (9)
- # slack-help (3)
- # spacemacs (2)
- # specter (13)
- # uncomplicate (1)
- # unrepl (22)
- # untangled (10)
- # yada (36)
The macro clojure.spec/keys and clojure.spec/keys* expects a seq of keys as the value of its named arguments :req and :opt. I want to use the same list of keys for two different specs, one using keys and one using keys*. But the macros get passed the quoted symbol for the variable and not the value of it. Is it possible to unpack the value pointed to by a symbol at read time like the common lisp #. syntax?
I've described the issue in longer form on SO: http://stackoverflow.com/questions/43321732/is-it-possible-to-resolve-a-symbol-to-its-value-before-passing-it-to-macro-in-cl
(eval `(s/def ::record (s/keys :req ~ks)))
is what I’ve been using when generating specs from dataI'm sorry, I'm having trouble finding this in the docs (which leads me to believe core.spec has some kind of strong opinion on this) -- is there a canonical way of saying "a predicate that matches anything". essentially a predicate (fn [thing] true)
are there any efforts for a spec-based condp
-like macro?
something that would be a more general core.match