81 : !is_undef( v[i] ) ? v[i]
164 : (!is_undef(i2) && (i1 > i2)) ?
empty_lst
166 : ((is_undef(i) && (v[i1] == mv)) || (v[i1][i] == mv)) ?
169 : concat(i1,
find(mv, v, c-1, i, i1+1, i2))
171 :
find(mv, v, c, i, i1+1, i2);
196 ) = (s ==
false) ? len(
find(mv, v, 0, i))
197 : len(
merge_s(search(mv, v, 0, i)));
260 function first( v ) = v[0];
274 function second( v ) = v[1];
288 function third( v ) = v[2];
334 : (len(v) < 2) ? undef
353 : (len(v) < 3) ? undef
354 : [v[0], v[1], v[2]];
386 : [v[l-3], v[l-2], v[l-1]];
409 : let ( s = min(n-1, len(v)-1) )
410 [
for (i = [0 : s]) v[i]];
433 : let ( s = max(0, len(v)-n) )
434 [
for (i = [s : len(v)-1]) v[i]];
455 : let ( s = min(len(v)-1, len(v)-1-n) )
456 [
for (i = [0 : s]) v[i]];
477 : [
for (i = [max(0, n) : len(v)-1]) v[i]];
493 : [
for (i = [len(v)-1 : -1 : 0]) v[i]];
529 [
if (m && c)
for (i = [l-m : l-1]) v[i],
for (i = [0 : l-1-m]) v[i] ]
531 : [
for (i = [m : l-1]) v[i],
if (m && c)
for (i = [0 : m-1]) v[i] ];
551 : is_list(i) && ((min([
for (y=i) y])<0) || (max([
for (y=i) y])>(len(v)-1))) ? undef
552 :
is_range(i) && ((min([
for (y=i) y])<0) || (max([
for (y=i) y])>(len(v)-1))) ? undef
554 [
for (j = [
for (k=s) k]) v[j]];
587 for (i=[0 : s : (len(v)-((w ==
true) ? 1 : n)) ])
589 for (j=[i : (i+n-1)])
642 :
is_empty(v) ? ((j ==
true) ? [concat(nv)] : concat(nv))
651 (j == true && l == true ) ? [concat(ce, nv)]
652 : (j == true && l == false) ? [ce]
653 : (j == false && l == true ) ? concat(ce, nv)
656 : (j == true) ? concat( [concat(ce, nv)],
append_e(nv,
tailn(v), r, j, l) )
657 : concat( concat(ce, nv) ,
append_e(nv,
tailn(v), r, j, l) );
705 : (
is_empty(v) && ( (i != 0) || !is_undef(mv)) ) ? undef
712 ( s == false ) ?
find(mv, v, 0, si)[mi]
713 :
merge_s(search(mv, v, 0, si), false)[mi]
718 h = ( !is_undef(p) && (p>0) ) ? [for (j = [0 : p-1]) v[j]] :
empty_lst,
720 t = ( is_undef(p) || (p>len(v)-1) ) ?
empty_lst : [for (j = [p : len(v)-1]) v[j]]
723 is_undef(p) ? undef : concat(h, nv, t);
773 : is_list(i) && ((min([
for (y=i) y])<0) || (max([
for (y=i) y])>(len(v)-1))) ? undef
774 :
is_range(i) && ((min([
for (y=i) y])<0) || (max([
for (y=i) y])>(len(v)-1))) ? undef
779 ( s == false ) ?
find(mv, v, mc, si)
780 :
merge_s(search(mv, v, mc, si),
false)
790 for (j = [0 : len(v)-1])
841 ) = is_undef(m) ?
headn(v, 0)
851 j = ((r == true) ? l - len(m) : 0) + o
854 for (i = [0 : len(m)-1])
empty_lst
<list> A list with no values (the empty list).
function headn(v, n=1)
Return a list containing all but the last n elements of an iterable value.
function firstn(v, n=1)
Return a list containing the first n elements of an iterable value.
function unique(v)
Return a list of the unique elements of an iterable value.
function select_r(v, i)
Select a range of elements from an iterable value.
function append_e(nv, v, r=true, j=true, l=true)
Append a value to each element of an iterable value.
function find(mv, v, c=1, i, i1=0, i2)
Find the occurrences of a match value in an iterable value.
function first3(v)
Return a list containing the first three elements of an iterable value.
function first2(v)
Return a list containing the first two elements of an iterable value.
function defined_e_or(v, i, d)
Return an element of an iterable when it exists or a default value otherwise.
function last3(v)
Return a list containing the last three elements of an iterable value.
function third(v)
Return the third element of an iterable value.
function last(v)
Return the last element of an iterable value.
function exists(mv, v, s=true, i)
Check for the existence of a match value in an iterable value.
function count(mv, v, s=true, i)
Count all occurrences of a match value in an iterable value.
function insert(nv, v, i=0, mv, mi=0, s=true, si)
Insert a new value into an iterable value.
function shift(v, n=0, r=true, c=true)
Shift the elements of an iterable value.
function exists_e(i, v)
Test if an element exists at a specified index of an iterable value.
function mask(v, m, r=false, o=0, u=undef, z=0)
Apply a binary mask to an interable value.
function strip(v, mv=empty_lst)
Strip all matching values from an iterable value.
function second(v)
Return the second element of an iterable value.
function lastn(v, n=1)
Return a list containing the last n elements of an iterable value.
function middle(v)
Return the middle element of an iterable value.
function delete(v, i, mv, mc=1, s=true, si)
Delete elements from an iterable value.
function first(v)
Return the first element of an iterable value.
function sequence_ns(v, n=1, s=1, w=false)
Return a list of all n-element sequential-subsets of an iterable value.
function last2(v)
Return a list containing the last two elements of an iterable value.
function tailn(v, n=1)
Return a list containing all but the first n elements of an iterable value.
function reverse(v)
Reverse the elements of an iterable value.
function all_defined(v)
Test if no element of an iterable value has an undefined value.
function is_iterable(v)
Test if a value has multiple parts and is iterable.
function is_empty(v)
Test if an iterable value is empty.
function merge_s(v, r=false)
Serially merge the elements of a list.
function is_between(v, l, u)
Test if a numerical value is between an upper and lower bounds.
function is_defined(v)
Test if a value is defined.
function is_number(v)
Test if a value is a number.
function is_range(v)
Test if a value is a range definition.