This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-22
Channels
- # beginners (43)
- # bristol-clojurians (2)
- # calva (11)
- # cider (10)
- # clj-kondo (3)
- # clojars (19)
- # clojure (93)
- # clojure-france (44)
- # clojure-nl (10)
- # clojure-uk (15)
- # clojuredesign-podcast (1)
- # clr (6)
- # core-typed (102)
- # data-science (1)
- # datomic (11)
- # docker (4)
- # emacs (12)
- # fulcro (27)
- # graalvm (6)
- # joker (1)
- # leiningen (4)
- # lumo (20)
- # nrepl (3)
- # off-topic (63)
- # parinfer (4)
- # reagent (40)
- # remote-jobs (2)
- # shadow-cljs (18)
- # spacemacs (7)
- # tree-sitter (7)
- # yada (3)
Hey guys, beginner question: c-c c-d c-d
give me a nice documentation,
1. is there a way to figure out the type of the argument?
2. examples like how I see in the clojuredocs would be nice, is there a way of getting that?
What do you mean by the type of the argument? Clojure is dynamically typed so it (usually) cannot know what the type is.
Yes, but there's no type information, it fails at runtime if you provide a wrong argument.
@U11BV7MTK ho nice!
My mini buffer did show clojure.core/into: ([] [to] [to from])
if it showed something like clojure.core/into: ([] [to:seq] [to:seq from:seq])
it would have been way easier.
That would mean you have to somehow parse the docs and infer "types" from there. There's no standard for that. For functions that have spec you can look at that though
In the example you would potentially have a long list of types that into accepts, or the more generic xs. Into can take any collection types and not just sequences.
Most functions in clojure.core
are designed to be very generic.