cons
Category: Pair procedures
;;; (cons val1 val2) -> pair?
;;; val1 : any?
;;; val2 : any?
;;; Create a pair from `val1` and `val2`.
;;;;
;;; Note: Non-list pairs are shown with a period between the values.
> (cons 1 2)
'(1 . 2)
> (cons "x" "y")
'("x" . "y")
> (pair? (cons 1 2))
#t
Forthcoming.
Why don’t you have an implementation of cons
?
cons
is a primitive procedure. It’s (nearly) impossible to implement it in terms of more basic operations.