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. ==== ADDROT ==== <callout type="primary" color="" icon="fa fa-book" title="Synopsis"> ---- Add elements to a list, keeping only the last N elements </callout> <callout color="green" icon="fa fa-indent" title="Stack Diagram"> ---- ^ __Input Stack__ ^^^ ^ __Output Stack__ ^ | **L<sub>data</sub>** | **O<sub>item</sub>** | **I<sub>size</sub>** | **→** | **L<sub>data-upd</sub>** | | //Level 3// | //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 ''ADDROT'' command adds element to a list just like the command ''[[manual:chapter6:lists:cmd_add|ADD]]'' does, but with a difference: if the list grows larger than **I<sub>size</sub>** elements, the first one gets removed. </callout> <callout type="danger" icon="true" title="Compatibility"> ---- ''ADDROT'' is specific to **newRPL** and has no direct equivalent in **userRPL**. </callout> <callout type="info" icon="true" title="Usage"> ---- **__Input__** <code> 4: 3: { A B C } 2: X 1: 3 ………………………………………………………………………………………………………… ADDROT </code> \\ **__Output__** <code> 4: 3: 2: 1: { B C X } ………………………………………………………………………………………………………… </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_addrot.txt Last modified: 2021/10/03 13:48by jojo1973