==== SEQ ==== ---- Assemble a list from results of sequential procedure ---- ^ __Input Stack__ ^^^^^ ^ __Output Stack__ ^ | **Pexec** | **Nindex** | **Numstart** | **Numend** | **Numincr** | **→** | **Lresults** | | **Aexec** | **Nindex** | **Numstart** | **Numend** | **Numincr** | **→** | **Lresults** | | **Nexec** | **Nindex** | **Numstart** | **Numend** | **Numincr** | **→** | **Lresults** | | //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// || ---- 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 **Nindex** over the range **Numstart** to **Numend**, in increments of **Numincr**. \\ \\ The action of ''SEQ'' for arbitrary inputs can be predicted exactly from this equivalent program: Numstart Numend FOR 'Nindex' Pexec EVAL Numincr STEP n → LIST 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 **Nindex** becomes a local variable regardless of its original type. ---- ''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. ---- **__Input__** 5: 'n^2' 4: 'n' 3: 1 2: 9 1: 2 ………………………………………………………………………………………………………… SEQ \\ **__Output__** 4: 3: 2: 1: { '1' '9' '25' '49' '81' } ………………………………………………………………………………………………………… ---- {{page>manual:chapter6:lists&nofooter&noeditbtn&inline}}