The 'cons' function takes two expressions and constructs a new list from them. If the 'expr-cdr' is not a list, then the result will be a 'dotted-pair'.
(cons 'a 'b) ; returns (A . B) (cons 'a nil) ; returns (A) (cons 'a '(b)) ; returns (A B) (cons '(a b) '(c d)) ; returns ((A B) C D) (cons '(a b) 'c) ; returns ((A B) . C) (cons (- 4 3) '(2 3)) ; returns (1 2 3)
See the
cons
function in the