cons
Category: List procedures
;;; (cons val lst) -> list?
;;; val : any?
;;; lst : list?
;;; Create a new list by adding `val` to the front of `lst`.
> (cons "x" (cons "y" null))
'("x" "y")
> (cons 1 (list "x" "y" "z"))
'(1 "x" "y" "z")
> (cons "hello" null)
'("hello")
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.