This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-09
Channels
- # announcements (1)
- # aws-lambda (3)
- # babashka (6)
- # beginners (91)
- # bristol-clojurians (5)
- # calva (25)
- # chlorine-clover (8)
- # cider (6)
- # clj-kondo (13)
- # cljdoc (10)
- # cljsrn (1)
- # clojure (80)
- # clojure-berlin (6)
- # clojure-europe (29)
- # clojure-nl (4)
- # clojure-spec (18)
- # clojure-uk (51)
- # clojurescript (41)
- # conjure (55)
- # cursive (3)
- # datomic (58)
- # emacs (9)
- # events (1)
- # figwheel-main (2)
- # fulcro (29)
- # graphql (12)
- # helix (4)
- # jobs (4)
- # klipse (8)
- # london-clojurians (1)
- # malli (5)
- # off-topic (13)
- # portal (9)
- # re-frame (30)
- # shadow-cljs (44)
- # spacemacs (7)
- # specter (3)
- # sql (11)
- # tools-deps (71)
- # windows (1)
- # xtdb (10)
Pushed the experiment to a repo: https://github.com/clj-kondo/inspector Contributions welcome.
Hmm, I realize that this is just valid Clojure syntax:
(defn foo [^:int x ^:keyword y ^:string z]
[x y z])
(prn (foo 1 2 3))
Could be a way to integrate clojure spec with existing defns without the need for writing another macro.we're not going to do that, but there are some other ideas percolating
Unambiguous:
user=> (alias 'c 'clojure.core)
nil
user=> ::c/int?
:clojure.core/int?
user=> (defn foo [^::c/int? x])
Bit ugly, but one of those things that could have been deemed: yeah, Rich intended it like this all along, it was all from a design originating back to 2002 ;)
except it's the opposite of what Rich intends :)
this just plays to the familiarity from static typing langs, which is just not what Rich is trying to do with spec
This would not be limited to simple annotations. You could do:
user=> (s/def ::foo (s/keys :req-un [::x]))
:user/foo
user=> (defn f [^::foo m])
so I don't get the static typing remark.it looks like static typed function signatures, but it's not
so making things that are different look the same causes confusion
there are other considerations as well - compilation, evaluation, reuse across arities, combination with other features that don't exist yet, etc
Rich is looking at all that and considering a wide variety of options including the one above
I just think this one is probably unlikely based on what I've heard