Fork me on GitHub

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.


To some degree there is, e.g into take a sequence


Yes, but there's no type information, it fails at runtime if you provide a wrong argument.


C-c C-d C-c will load the clojuredocs examples in a buffer


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


right, my argument is that it would boost the productivity.


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.