User Tools

A PCRE internal error occured. This might be caused by a faulty plugin

====== Function CONS ====== ====Syntax==== * **cons** //object-1// //object-2// → //cons// ====Arguments and values==== * //object-1// - an //[[CL:Glossary:object]]//. * //object-2// - an //[[CL:Glossary:object]]//. * //cons// - a //[[CL:Glossary:cons]]//. ====Description==== Creates a //[[CL:Glossary:fresh]]// //[[CL:Glossary:cons]]//, the //[[CL:Glossary:car]]// of which is //object-1// and the //[[CL:Glossary:cdr]]// of which is //object-2//. ====Examples==== <blockquote> (cons 1 2) <r>(1 . 2)</r> (cons 1 [[CL:Constant Variable:nil]]) <r>(1)</r> (cons [[CL:Constant Variable:nil]] 2) <r>([[CL:Constant Variable:nil|NIL]] . 2)</r> (cons [[CL:Constant Variable:nil]] [[CL:Constant Variable:nil]]) <r>([[CL:Constant Variable:nil|NIL]])</r> (cons 1 (cons 2 (cons 3 (cons 4 [[CL:Constant Variable:nil]])))) <r>(1 2 3 4)</r> (cons 'a 'b) <r>(A . B)</r> (cons 'a (cons 'b (cons 'c '()))) <r>(A B C)</r> (cons 'a '(b c d)) <r>(A B C D)</r> </blockquote> ====Side Effects==== None. ====Affected By==== None. ====Exceptional Situations==== None. ====See also==== **[[CL:Functions:list|Function LIST]]** ====Example Implementation==== To be done. ====Notes==== If //object-2// is a //[[CL:Glossary:list]]//, **cons** can be thought of as producing a new //[[CL:Glossary:list]]// which is like it but has //object-1// prepended.