OSDN Git Service

Working to clean up docs.
[joypy/Thun.git] / docs / reference / cons.md
1 --------------------
2
3 ## cons
4
5 (Basis Function)
6
7 Given an item and a list, append the item to the list to make a new list.
8
9        A [...] cons
10     ------------------
11          [A ...]
12
13 ### Source
14
15     func(cons, [list(A), B|S], [list([B|A])|S]).
16
17 ### Discussion
18
19 Cons is a venerable old function from Lisp.  It doesn't inspect the item
20 but it will not cons onto a non-list.  It's inverse operation is called
21 `uncons`.
22
23 ### Crosslinks
24
25 [ccons](#ccons)
26 [uncons](#uncons)
27