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. ==== STREAM ==== <callout type="primary" color="" icon="fa fa-book" title="Synopsis"> ---- Assemble a list from results of sequential procedure </callout> <callout color="green" icon="fa fa-indent" title="Stack Diagram"> ---- ^ __Input Stack__ ^^ ^ __Output Stack__ ^ | **L<sub>data</sub>** | **P<sub>exec</sub>** | **→** | **O<sub>result</sub>** | | **L<sub>data</sub>** | **N<sub>exec</sub>** | **→** | **O<sub>result</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 ''STREAM'' command moves the first two elements from **L<sub>data</sub>** onto the stack, ''[[manual:chapter6:operators:cmd_ovr_eval|EVAL]]''uating a program or an identifier. Then moves the next element (if any) onto the stack, and ''[[manual:chapter6:operators:cmd_ovr_eval|EVAL]]''uates **P<sub>exec</sub>** (or **N<sub>exec</sub>**) again using the previous result and the new element. Repeats this until **L<sub>data</sub>** is exhausted, and returns the final result. \\ \\ ''STREAM'' is nominally designed for **P<sub>exec</sub>** (or **N<sub>exec</sub>**) __requiring two arguments and returning one result__. </callout> <callout type="warning" icon="true" title="Compatibility"> ---- ''STREAM'' is not fully equivalent to its **userRPL** counterpart. In particular: * the program launched by ''STREAM'' operates in a protected stack environment: no elements present on the stack before ''STREAM'' is launched can be reached or altered. </callout> <callout type="info" icon="true" title="Usage"> ---- **__Input__** <code> 4: 3: 2: { "A" "B" "C" "D" } 1: « SWAP + » ………………………………………………………………………………………………………… STREAM </code> \\ **__Output__** <code> 4: 3: 2: 1: "DCBA" ………………………………………………………………………………………………………… </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_stream.txt Last modified: 2021/11/25 14:13by jojo1973