cons
cons — constructs a cons cell.
cons (car_exp, cdr_exp)
car_expAny Gamma or Lisp expression.
cdr_expAny Gamma or Lisp expression.
A list whose car is car_exp and whose cdr is
cdr_exp.
This function constructs a list whose car and cdr are
car_exp and cdr_exp
respectively. This construction is also known as a cons
cell. If the cdr_exp is a list, this
has the effect of increasing the list by one member, that is, adding the
car_exp to the beginning of the
cdr_exp.
Gamma>a = list(2,3,4);(2 3 4)Gamma>b = 5;5Gamma>cons(b,a);(5 2 3 4)Gamma>cons(a,b);((2 3 4) . 5)Gamma>cons(5,nil);(5)Gamma>