This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-13
Channels
- # adventofcode (4)
- # announcements (1)
- # babashka (7)
- # beginners (51)
- # calva (18)
- # cider (15)
- # clj-kondo (1)
- # cljsrn (6)
- # clojure (99)
- # clojure-dev (31)
- # clojure-europe (5)
- # clojure-france (2)
- # clojure-italy (3)
- # clojure-nl (14)
- # clojure-seattle (8)
- # clojure-spec (6)
- # clojure-uk (2)
- # clojurescript (23)
- # conjure (3)
- # css (6)
- # data-science (3)
- # datomic (19)
- # events (6)
- # fulcro (13)
- # graalvm (5)
- # honeysql (24)
- # inf-clojure (19)
- # music (10)
- # off-topic (28)
- # pathom (10)
- # rdf (15)
- # re-frame (11)
- # releases (4)
- # sci (1)
- # shadow-cljs (18)
I was playing with built-in specs and discovered there are A LOT of places to embed var metadata in defn:
(defn ^{:b 1} foo
{:c 1}
([])
{:a 1})
:a
, :b
and :c
all end up in var meta!> I wonder how's that I guess it's because if there was just one place, people could accidentally place it elsewhere and get no metadata attached
I found that when I spec’ed it and asked Rich about it. The thought at the time was that metadata might get big (this predated some of the ^ syntax) and it would obscure the main part of the function so you could put it at the end
It’s rarely used but I did find some places using when testing a spec without it