==== ADD ====
----
Concatenate lists and/or elements
----
^ __Input Stack__ ^^ ^ __Output Stack__ ^
| **L1** | **L2** | **→** | **Lconcat** |
| **L1** | **O** | **→** | **L1-upd** |
| **O** | **L2** | **→** | **L2-upd** |
| **O1** | **O2** | **→** | **Lnew** |
| //Level 2// | //Level 1// | //→// | //Level 1// |
{{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}}
| **Keyword type** | [[manual:chapter5:basics#commands|Command]] ||
| **Parallel list processing capabilities** | [[manual:chapter5:listproc#group-2commands-that-must-use-dolist-to-parallel-process|Group 2]] | //Commands that must use //''[[manual:chapter6:lists:cmd_cmddolist|DOLIST]]''// to parallel process// |
| **Affected by flags** | //None// ||
----
The ''ADD'' command concatenates lists or adds an element to a new list. It's not necessary that either the first or the second argument is a list: in this case ''ADD'' will create a new list containing both: in other words, single objects are treated as one-element lists.
----
''ADD'' is not fully equivalent to its **userRPL** counterpart.
In particular:
* in **userRPL** list concatenation is performed by the ''[[manual:chapter6:operators:cmd_ovr_add|+]]'' operator, while ''ADD'' is the command to parallel process the addition;
* in **userRPL** at least one of the arguments must be a list.
----
**__Input__**
4:
3:
2: { 1 1 2 3 }
1: { 5 8 13 }
…………………………………………………………………………………………………………
ADD
\\
**__Output__**
4:
3:
2:
1: { 1 1 2 3 5 8 13 }
…………………………………………………………………………………………………………
----
{{page>manual:chapter6:lists&nofooter&noeditbtn&inline}}