An observation about cons in Clojure

Cons behavior in Clojure is a bit different from Command Lisp. The second argument of cons in Clojure has to be sequence; not atom nor other. For example,

(cons 1 (list 2 3)) works both on Common Lisp and Clojure. However (cons 1 2) does not work on Clojure. This difference does not break my code when I want to port them from Common Lisp to Clojure; because (cons 1 nil) still works.

Moreover, Clojure’s PersistentList does not implemented explicitly based on cons cells, although it is quite similar to cons cells. Thank Nuttanart Pornprasitsakul for showing this code to me. But still I cannot find any effect to my existing code.

In short, there are some different details about cons in Clojure and Common Lisp, although for me, it does not matter.