4 ms·
Sure, it does have cons, but your second argument wasn't a sequence. Try: > (cons 'a ['b]) (a b) > (doc cons) ------------------------- clojure.core
by dewitt 11y ago
Sure, it does have cons, but your second argument wasn't a sequence. Try:
> (cons 'a ['b])
(a b)
> (doc cons)
-------------------------
clojure.core/cons
([x seq])
Returns a new seq where x is the first element and seq is the rest.
- tokenrove 11y agoIn other Lisps, a cons can be an arbitrary pair.
- TazeTSchnitzel 11y agoThat's not a cons, that's a linked list. As tokenrove mentions, a cons in a Lisp is just a tuple (`cons` is the name of the type and the function constructing it). It can contain any two values.