73 ) = (len(v) > i) ? v[i] : d;
152 : (i1 > i2) ? empty_lst
153 : (i1 > len(v)-1) ? empty_lst
154 : ((
not_defined(i) && (v[i1] == mv)) || (v[i1][i] == mv)) ?
157 : concat(i1,
find(mv, v, c-1, i, i1+1, i2))
159 :
find(mv, v, c, i, i1+1, i2);
180 len(
find(mv, v, 0, i))
181 : len(
smerge(search(mv, v, 0, i)));
218 function first( v ) = v[0];
232 function second( v ) = v[1];
246 function third( v ) = v[2];
256 function last( v ) = v[len(v)-1];
275 : [
for (i = [0 : min(n-1, len(v)-1)]) v[i]];
294 : [
for (i = [max(0, len(v)-n) : len(v)-1]) v[i]];
313 : (n >= len(v)) ? empty_lst
314 : [
for (i = [0 : min(len(v)-1, len(v)-1-n)]) v[i]];
333 : (n >= len(v)) ? empty_lst
334 : [
for (i = [max(0, n) : len(v)-1]) v[i]];
350 : [
for (i = [len(v)-1 : -1 : 0]) v[i]];
369 :
is_number(i) && ((i<0) || (i>(len(v)-1))) ? undef
370 :
is_list(i) && ((min([
for (y=i) y])<0) || (max([
for (y=i) y])>(len(v)-1))) ? undef
371 :
is_range(i) && ((min([
for (y=i) y])<0) || (max([
for (y=i) y])>(len(v)-1))) ? undef
376 [
for (j = [
for (k=s) k]) v[j]];
408 for (i=[0 : s : (len(v)-((w ==
true) ? 1 : n)) ])
410 for (j=[i : (i+n-1)])
460 :
is_empty(v) ? ((j ==
true) ? [concat(nv)] : concat(nv))
467 (j == true) ? (l == true) ? [concat(ce, nv)] : [ce]
468 : (l == true) ? concat(ce, nv) : ce
470 : (j == true) ? concat([concat(ce, nv)],
eappend(nv,
ntail(v), r, j, l))
471 : concat(concat(ce, nv),
eappend(nv,
ntail(v), r, j, l));
520 ) ? concat(nv) : undef
521 : ((i<0) || (i>len(v))) ? undef
527 find(mv, v, 0, si)[mi]
528 :
smerge(search(mv, v, 0, si),
false)[mi]
532 h = (p>0) ? [
for (j = [0 : p-1]) v[j]] : empty_lst,
533 t = (p>len(v)-1) ? empty_lst : [
for (j = [p : len(v)-1]) v[j]]
535 all_equal([h, t], empty_lst) ? undef : concat(h, nv, t);
579 :
is_number(i) && ((i<0) || (i>(len(v)-1))) ? undef
580 :
is_list(i) && ((min([
for (y=i) y])<0) || (max([
for (y=i) y])>(len(v)-1))) ? undef
581 :
is_range(i) && ((min([
for (y=i) y])<0) || (max([
for (y=i) y])>(len(v)-1))) ? undef
588 :
smerge(search(mv, v, mc, si),
false)
596 for (j = [0 : len(v)-1])
function count(mv, v, s=true, i)
Count all occurrences of a match value in an iterable value.
function nssequence(v, n=1, s=1, w=false)
Return a list of all n-element sequential-subsets of an iterable value.
function is_empty(v)
Test if an iterable value is empty.
function nfirst(v, n=1)
Return a list containing the first n elements of an iterable value.
function second(v)
Return the second element of an iterable value.
function unique(v)
Return the unique elements of an iterable value.
function all_defined(v)
Test if no element of a list of values is undefined.
function edefined_or(v, i, d)
Return an iterable element when it exists or a default value when it does not.
function all_equal(v, cv)
Test if a list of values equal a comparison value.
function is_number(v)
Test if a value is a number.
function smerge(v, r=false)
Serial-merge lists of iterable values.
empty_lst
A list with no values (the empty list).
function not_defined(v)
Test if a value is not defined.
function exists(mv, v, s=true, i)
Check for the existence of a match value in an iterable value.
function nlast(v, n=1)
Return a list containing the last n elements of an iterable value.
function insert(nv, v, i=0, mv, mi=0, s=true, si)
Insert a new value into an iterable value.
function rselect(v, i)
Select a range of elements from an iterable value.
function strip(v, mv=empty_lst)
Strip all matching values from an iterable value.
function is_defined(v)
Test if a value is defined.
function is_range(v)
Test if a value is a range definition.
function is_list(v)
Test if a value is an iterable list of values.
function first(v)
Return the first element 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 nhead(v, n=1)
Return a list containing all but the last n elements of an iterable value.
function eappend(nv, v, r=true, j=true, l=true)
Append a value to each element of an iterable value.
function any_equal(v, cv)
Test if any element of a list of values equal a comparison value.
function reverse(v)
Reverse the elements of an iterable value.
function is_iterable(v)
Test if a value has multiple parts and is iterable.
function ntail(v, n=1)
Return a list containing all but the first n elements 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.