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. ==== SEQ ==== <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__ ^ | **P<sub>exec</sub>** | **N<sub>index</sub>** | **Num<sub>start</sub>** | **Num<sub>end</sub>** | **Num<sub>incr</sub>** | **→** | **L<sub>results</sub>** | | **A<sub>exec</sub>** | **N<sub>index</sub>** | **Num<sub>start</sub>** | **Num<sub>end</sub>** | **Num<sub>incr</sub>** | **→** | **L<sub>results</sub>** | | **N<sub>exec</sub>** | **N<sub>index</sub>** | **Num<sub>start</sub>** | **Num<sub>end</sub>** | **Num<sub>incr</sub>** | **→** | **L<sub>results</sub>** | | //Level 5// | //Level 4// | //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-7multiple-argument-one-result-commands|Group 7]] | //Multiple argument, one result commands// | | **Affected by flags** | //None// || </callout> <callout color="orangered" icon="fa fa-comment" title="Description"> ---- The ''SEQ'' command returns a list of results generated by repeatedly ''[[manual:chapter6:operators:cmd_ovr_eval|EVAL]]''uating a program, a symbolic object or an identifier using **N<sub>index</sub>** over the range **Num<sub>start</sub>** to **Num<sub>end</sub>**, in increments of **Num<sub>incr</sub>**. \\ \\ The action of ''SEQ'' for arbitrary inputs can be predicted exactly from this equivalent program: <code> Numstart Numend FOR 'Nindex' Pexec EVAL Numincr STEP n → LIST </code> where ''n'' is the number of new objects left on the stack by the ''[[manual:chapter6:docol2:cmd_for|FOR]]'' … ''[[manual:chapter6:docol2:cmd_step|STEP]]'' loop. Notice that **N<sub>index</sub>** becomes a local variable regardless of its original type. </callout> <callout type="warning" icon="true" title="Compatibility"> ---- ''SEQ'' is not fully equivalent to its **userRPL** counterpart. In particular: * the program launched by ''SEQ'' operates in a protected stack environment: no elements present on the stack before ''SEQ'' is launched can be reached or altered. </callout> <callout type="info" icon="true" title="Usage"> ---- **__Input__** <code> 5: 'n^2' 4: 'n' 3: 1 2: 9 1: 2 ………………………………………………………………………………………………………… SEQ </code> \\ **__Output__** <code> 4: 3: 2: 1: { '1' '9' '25' '49' '81' } ………………………………………………………………………………………………………… </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_seq.txt Last modified: 2021/10/02 07:55by jojo1973