Show pageDiscussionOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ==== ADD ==== <callout type="primary" color="" icon="fa fa-book" title="Synopsis"> ---- Concatenate lists and/or elements </callout> <callout color="green" icon="fa fa-indent" title="Stack Diagram"> ---- ^ __Input Stack__ ^^ ^ __Output Stack__ ^ | **L<sub>1</sub>** | **L<sub>2</sub>** | **→** | **L<sub>concat</sub>** | | **L<sub>1</sub>** | **O** | **→** | **L<sub>1-upd</sub>** | | **O** | **L<sub>2</sub>** | **→** | **L<sub>2-upd</sub>** | | **O<sub>1</sub>** | **O<sub>2</sub>** | **→** | **L<sub>new</sub>** | | //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// || </callout> <callout color="orangered" icon="fa fa-comment" title="Description"> ---- 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. </callout> <callout type="warning" icon="true" title="Compatibility"> ---- ''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. </callout> <callout type="info" icon="true" title="Usage"> ---- **__Input__** <code> 4: 3: 2: { 1 1 2 3 } 1: { 5 8 13 } ………………………………………………………………………………………………………… ADD </code> \\ **__Output__** <code> 4: 3: 2: 1: { 1 1 2 3 5 8 13 } ………………………………………………………………………………………………………… </code> </callout> <callout color="darkgray" icon="fa fa-hand-o-right" title="Related Commands"> ---- {{page>manual:chapter6:lists&nofooter&noeditbtn&inline}} </callout> manual/chapter6/lists/cmd_add.txt Last modified: 2021/10/03 14:03by jojo1973