Def mapc(f)(as) == Case of as; nil nil ; a.as1 f(a).mapc(f)(as1)
Def (recursive) | [mapc] |
Def f{m..n} == if nm nil else f(m).f{(m+1)..n} fi (recursive) | [listify] |
Def mapcons(f;as) == Case of as; nil nil ; a.as' f(a,as').mapcons(f;as')
Def (recursive) | [mapcons] |
Def reduce(f;k;as) == Case of as; nil k ; a.as' f(a,reduce(f;k;as'))
Def (recursive) | [reduce] |
Def as\[i]
Def == if i0 tl(as) else Case of as; nil nil ; a'.as' a'.as'\[i-1] fi
Def (recursive) | [reject] |
Def firstn(n;as)
Def == Case of as; nil nil ; a.as' if 0<n a.firstn(n-1;as') else nil fi
Def (recursive) | [firstn] |
Def rev(as) == Case of as; nil nil ; a.as' rev(as') @ [a] (recursive) | [reverse] |
Def nth_tl(n;as) == if n0 as else nth_tl(n-1;tl(as)) fi (recursive) | [nth_tl] |
Def map(f;as) == Case of as; nil nil ; a.as' f(a).map(f;as') (recursive) | [map] |
Def ||as|| == Case of as; nil 0 ; a.as' ||as'||+1 (recursive) | [length] |
Def as @ bs == Case of as; nil bs ; a.as' a.(as' @ bs) (recursive) | [append] |