script:
~adons/finance/finexec/toolbox/lists.ijs
Contributor: William Szuch
Updated: 2022 5 26
depend: nil
Definitions: loaded to locale base
Status: done
Script source:
lists.ijs
Definitions for creating lists of data, numeris
and text.
Definitions
extend (dyad)
Form: tacit
Extend the last item of a list.
Syntax
(N)extend(L)
N = number of items in the extended list
L = list to be extended
Example
(12)extend(1.01 1.02 1.03)
1.01 1.02 1.03 1.03 1.03 1.03 1.03 1.03 1.03 1.03 1.03 1.03
(2)extend(1.01 1.02 1.03 1.04 1.05)
1.01 1.02
(15)extend('asd')
asddddddddddddd
(6)extend('ad';1;2;'ZZ')
┌──┬─┬─┬──┬──┬──┐
│ad│1│2│ZZ│ZZ│ZZ│
└──┴─┴─┴──┴──┴──┘
extenda (dyad)
Form: tacit
Extend the last item of a list.
Similiar to extend except reversed.
Syntax
(L)extenda(N)
N = number of items in the extended list
L = list to be extended
Example
(1.01 1.02 1.03)extenda(12)
1.01 1.02 1.03 1.03 1.03 1.03 1.03 1.03 1.03 1.03 1.03 1.03
(1.01 1.02 1.03 1.04 1.05)extenda(2)
1.01 1.02
('asd')extenda(15)
asddddddddddddd
('ad';1;2;'ZZ')extenda(6)
┌──┬─┬─┬──┬──┬──┐
│ad│1│2│ZZ│ZZ│ZZ│
└──┴─┴─┴──┴──┴──┘
steps (monad)
Form: tacit
Generate uniform steps over a closed interval.
The end points of the interval are inculded.
Syntax
steps(A,B,N)
A = lower limit of range
B = upper limit of range
N = number of steps in the interval
Example
steps(0,10,5)
0 2 4 6 8 10
steps(1.0,1.1,10)
1 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.1