CONS
\kˈɒnz], \kˈɒnz], \k_ˈɒ_n_z]\
Sort: Oldest first
-
/konz/ or /kons/ A Lisp function which takes anelement H and a list T and returns a new list whose head is Hand whose tail is T.In Lisp, "cons" (short for "construct") is the fundamentaloperation for building structures. It actually takes any twoobjects and returns them in a "cons cell" or pair object. This issometimes called a dotted-pair because an application of cons: (cons H T)can also be input and output using an infix dot operator: (H . T) (with suitable quoting of arguments).A cons cell can also be used as two-branched tree node object withone object hanging from each branch. Because the result of a consis itself an object, it can be used to build binary trees of anyshape and complexity.Typically, a cons would be represented in memory as a twoconsecutive pointers.For historical reasons, the functions to return the objects in acons are called car and cdr.
By Denis Howe
Word of the day
Quinones
- Hydrocarbon rings which contain two moieties position. They can be substituted in any position except at the ketone groups.