TAVPL Library Documentation

Version 0.10.1+15+18d6cd generated 2024-11-11 07:22

Modules

TAVPL_rts.c
TAVPL_rtstav.tav
TAVPL_strings.c
TAVPL_inout.c
TAVPL_math.c
TAVPL_chunk.c
TAVPL_tavlib.tav
TAVPL_crypto.c
TAVPL_matrix.tav
TAVPL_readline.c
TAVPL_xml.tav
TAVPL_complex.tav
TAVPL_dfloat.tav

Literals

TAVPL_tavlib.tav

##MaxInt31 =               2'147'483'647
##MaxInt32 =               4'294'967'295
##MaxInt63 =   9'223'372'036'854'775'807
##MaxInt64 =  18'446'744'073'709'551'615
##Pi = 3.141'592'653'589'793'238'46
##E =  2.718'281'828'459'045'235'36
##Whitespace = ' &tab;&nl;&cr;'
##ASCIIupperLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
##ASCIIlowerLetters = 'abcdefghijklmnopqrstuvwxyz'
##ASCIIletters =  'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
##DecimalDigits = '0123456789'
##HexDigits = '01234567890abcdefABCDEF'
Class Functions

Index


as
basic bits boolean bunch
chunk command complex
debug dfloat directory
error
fault file float format from
give
integer is
join
map math matrix maximum minimum
network
pad print
quote
random rational row
sax sort string system
terminal time tuple

as

as float (str)  [STRINGS]
as integer (str)  [TAVLIB.TAV]
as integer (str) else (default)  [TAVLIB.TAV]
as string (num)  [STRINGS]

basic

new basic pipe  [INOUT]
basic pipe (@) close reading  [INOUT]
basic pipe (@) close writing  [INOUT]
basic pipe (@) get  [INOUT]
basic pipe (@) put (str)  [INOUT]

bits

bits (x) and (y)  [RTS]
bits (x) invert  [RTS]
bits (x) is (n) set  [RTS]
bits (x) or (y)  [RTS]
bits (x) shift (n)  [RTS]
bits (x) xor (y)  [RTS]

boolean

boolean (b) as string  [STRINGS]

bunch

bunch (bunch) get fields  [RTS]
bunch (bunch) give keys  [RTS]
bunch (bunch) give values  [RTS]
bunch (bunch) lock  [RTS]
bunch (bunch) set fields (map)  [RTS]
bunch (bunch) unlock  [RTS]

chunk

new chunk size (size)  [CHUNK]
chunk (tgt) at (toffset) size (tsize) put chunk (src) at (soffset) size (ssize)  [CHUNK]
chunk (ck) get integer at (offset) size (size)  [CHUNK]
chunk (ck) get string at (offset) size (size)  [CHUNK]
chunk (bcr) get string at (offset) size (size) until linefeed  [CHUNK]
chunk (bcr) get string at (offset) size (size) until zero  [CHUNK]
chunk (bcr) get string at (offset) size (size) until (stop)  [CHUNK]
chunk (tgt) put integer (src) at (offset) size (size)  [CHUNK]
chunk (tgt) put string (str) at (offset) size (len)  [CHUNK]
chunk (chunk) set byteorder (char)  [RTS]
chunk (ck) slice at (offset) size (size)  [CHUNK]
chunk (dk) zero  [CHUNK]
chunk (ck) zero at (offset)  [CHUNK]
chunk (ck) zero at (offset) size (size)  [CHUNK]

command

new command stream reads (command)  [INOUT]
new command stream write (command)  [INOUT]
command stream (@) close  [INOUT]
command stream (@) get  [INOUT]
command stream (@) put (string)  [INOUT]
command string (cmd) give lines  [TAVLIB.TAV]
command string (cmd) lines  [TAVLIB.TAV]
command (cmd) give lines  [TAVLIB.TAV]
command (cmd) lines  [TAVLIB.TAV]

complex

new complex (pair)  [COMPLEX.TAV]
new complex re (x) im (y)  [COMPLEX.TAV]
complex (this) abs  [COMPLEX.TAV]
complex (this) add (b)  [COMPLEX.TAV]
complex (this) arg  [COMPLEX.TAV]
complex (this) as string  [COMPLEX.TAV]
complex (this) cis  [COMPLEX.TAV]
complex (this) div (b)  [COMPLEX.TAV]
complex (this) im  [COMPLEX.TAV]
complex (this) mul (b)  [COMPLEX.TAV]
complex (this) re  [COMPLEX.TAV]
complex (this) sub (b)  [COMPLEX.TAV]

debug

debug disable  [RTS]
debug dump calls (depth)  [STRINGS]
debug dump (x)  [RTS]
debug enable  [RTS]
debug info (x)  [RTS]
debug is enabled  [RTS]
debug print (mixed)  [STRINGS]
debug print (mixed) here  [STRINGS]
debug print (mixed) lno  [STRINGS]
debug print (mixed) nonl  [STRINGS]

dfloat

new dfloat (x)  [DFLOAT.TAV]
dfloat (this) add (b)  [DFLOAT.TAV]
dfloat (this) as float  [DFLOAT.TAV]
dfloat (this) as string  [DFLOAT.TAV]
dfloat (this) digits (p)  [DFLOAT.TAV]
dfloat (this) div (b)  [DFLOAT.TAV]
dfloat (this) is greater (b)  [DFLOAT.TAV]
dfloat (this) is less (b)  [DFLOAT.TAV]
dfloat (this) is negative  [DFLOAT.TAV]
dfloat (this) is positive  [DFLOAT.TAV]
dfloat (this) mul (b)  [DFLOAT.TAV]
dfloat (this) neg  [DFLOAT.TAV]
dfloat (this) norm  [DFLOAT.TAV]
dfloat (this) round (p)  [DFLOAT.TAV]
dfloat (this) sqrt  [DFLOAT.TAV]
dfloat (this) sub (b)  [DFLOAT.TAV]

directory

new directory stream reads (dirnam)  [INOUT]
directory stream (@) close  [INOUT]
directory stream (@) get  [INOUT]
directory (dirpath) create  [INOUT]
directory (dir) filenames  [TAVLIB.TAV]
directory (dir) give filenames  [TAVLIB.TAV]
directory (dir) newest (pattern)  [TAVLIB.TAV]

error

error dump calls (depth)  [STRINGS]
error dump used items  [RTS]
error dump (x)  [RTS]
error dump (x) (depth)  [RTS]
error info (x)  [RTS]
error print (mixed)  [STRINGS]
error print (mixed) here  [STRINGS]
error print (mixed) lno  [STRINGS]
error print (mixed) nonl  [STRINGS]

fault

new fault (errno) message (msg)  [RTS]
new fault (errno)  [RTS]
fault (@) mark checked  [RTS]
fault (@) print  [RTSTAV.TAV]
fault (@) print backtrace  [RTSTAV.TAV]
fault (@) print stop  [RTSTAV.TAV]

file

new file chunk append (fn)  [INOUT]
new file chunk create (fn)  [INOUT]
new file chunk modify (fn)  [INOUT]
new file chunk read (fn)  [INOUT]
file chunk (fd) close  [INOUT]
file chunk (fd) position (loc) current  [INOUT]
file chunk (fd) position (loc) end  [INOUT]
file chunk (fd) position (loc) start  [INOUT]
file chunk (fd) read (ck) at (pos) size (size)  [INOUT]
file chunk (fd) tell position  [INOUT]
file chunk (fd) write (ck) at (pos) size (size)  [INOUT]
file standard input give lines  [TAVLIB.TAV]
new file stream appends (fn)  [INOUT]
new file stream filename (fn) mode (str)  [INOUT]
new file stream modifies (fn)  [INOUT]
new file stream reads (fn)  [INOUT]
new file stream replaces (fn)  [INOUT]
new file stream rewrites (fn)  [INOUT]
new file stream updates (fn)  [INOUT]
file stream (@) append (line) atomically  [INOUT]
file stream (@) close  [INOUT]
file stream (@) flush  [INOUT]
file stream (@) get  [INOUT]
file stream (stream) is tty  [INOUT]
file stream (@) put (string)  [INOUT]
file stream (@) seek (loc)  [INOUT]
file stream (@) tell  [INOUT]
file (filename) as XML tree  [XML.TAV]
file (filename) attributes  [INOUT]
file (filename) extended attribute (attrname)  [INOUT]
file (filename) extended attribute (attrname) set (value)  [INOUT]
file (filename) give lines  [TAVLIB.TAV]
file (filename) hard link to (newfilename)  [INOUT]
file (filename) lines  [TAVLIB.TAV]
file (filename) real pathname  [INOUT]
file (filename) symbolic link to (newfilename)  [INOUT]
file (filename) unlink  [INOUT]

float

float (this) as dfloat (prec)  [DFLOAT.TAV]
float (@) as integer  [RTSTAV.TAV]
float (@) as string  [STRINGS]
float (@) as string digits (d)  [STRINGS]
float (@) as string fixed (d)  [STRINGS]
float (@) as string strict (d)  [STRINGS]
float (@) as string (d)  [STRINGS]
float (x) is near (y)  [RTS]
float (x) is near (y) by (d)  [RTS]
float (x) split binary  [MATH]
float (x) split decimal  [RTSTAV.TAV]

format

format (fmt) (list)  [TAVLIB.TAV]

from

from (first) downto (last)  [RTSTAV.TAV]
from (first) downto (last) step (step)  [RTSTAV.TAV]
from (start) to (end)  [RTSTAV.TAV]
from (first) to (last) step (step)  [RTSTAV.TAV]
from (first) upto (last)  [RTSTAV.TAV]
from (start) upto (last) give tuples  [TAVLIB.TAV]
from (first) upto (last) step (step)  [RTSTAV.TAV]

give

give keys (bunch)  [RTS]
give numbers (arg)  [RTSTAV.TAV]
give until void (val)  [TAVLIB.TAV]
give values (bunch)  [RTS]
give while positive (val)  [TAVLIB.TAV]
give while (cond) value (val)  [TAVLIB.TAV]

integer

integer (this) as dfloat  [DFLOAT.TAV]
integer (@) as float  [RTS]
integer (@) as string  [STRINGS]
integer (@) as string base (basespec)  [TAVLIB.TAV]
integer (i) code point as string  [STRINGS]
integer (@) hash  [RTS]

is

is (x) big  [RTS]
is (x) boolean  [RTS]
is (x) chunk  [RTS]
is (x) command stream  [INOUT]
is (x) even  [RTS]
is (x) fault  [RTS]
is (@) fault backtrace  [RTSTAV.TAV]
is (@) fault stop  [RTSTAV.TAV]
is (x) file stream  [INOUT]
is (x) float  [RTS]
is (x) function  [RTS]
is (val) in (src)  [TAVLIB.TAV]
is (x) integer  [RTS]
is (x) invalid  [RTS]
is (x) map  [RTS]
is (x) matrix  [MATRIX.TAV]
is (x) number  [RTS]
is (x) odd  [RTS]
is (x) proxy  [RTS]
is (x) rational  [RTS]
is (x) row  [RTS]
is (x) string  [RTS]
is (x) tuple  [RTS]
is (x) void  [RTS]

join

join (rmt)  [TAVLIB.TAV]
join (rmt) by (sep)  [TAVLIB.TAV]

map

new map  [RTS]
new map (tagname)  [TAVLIB.TAV]
map (@) add pairs (rmt)  [TAVLIB.TAV]
map (@) as string key (delim) join (sep) quote (qr)  [TAVLIB.TAV]
map (@) copy  [TAVLIB.TAV]
map (@) copy lean  [TAVLIB.TAV]
map (@) find (val)  [TAVLIB.TAV]
map (@) find (val) all  [TAVLIB.TAV]
map (@) give keys  [RTS]
map (@) give keys ascending  [TAVLIB.TAV]
map (@) give keys ascending values  [TAVLIB.TAV]
map (@) give keys descending  [TAVLIB.TAV]
map (@) give keys descending values  [TAVLIB.TAV]
map (@) give keys using (func)  [TAVLIB.TAV]
map (@) give keys using (func) with (extra)  [TAVLIB.TAV]
map (@) give pairs  [RTSTAV.TAV]
map (@) give values  [RTSTAV.TAV]
map (@) hashed  [RTS]
map (@) invert  [TAVLIB.TAV]
map (@) join values by (sep)  [TAVLIB.TAV]
map (@) key by value (val)  [RTSTAV.TAV]
map (@) keys  [RTS]
map (@) keys as row  [RTS]
map (@) keys by value (val)  [TAVLIB.TAV]
map (@) lock  [RTS]
map (@) max  [TAVLIB.TAV]
map (@) min  [TAVLIB.TAV]
map (@) pairs key value  [RTS]
map (@) pairs value key  [RTS]
map (@) unlock  [RTS]
map (@) value key pairs as row  [TAVLIB.TAV]
map (@) values  [RTS]
map (@) values as row  [RTS]

math

math abs (item)  [RTS]
math arc cos (arg)  [MATH]
math arc sin (arg)  [MATH]
math arc tan (arg)  [MATH]
math arc tan (y) by (x)  [MATH]
math base (base) exp (exponent)  [MATH]
math base (base) exp (exponent) by square and multiply  [TAVLIB.TAV]
math base (base) log (arg)  [MATH]
math ceil (an)  [RTS]
math cos (arg)  [MATH]
math exp (arg)  [MATH]
math float (x)  [RTS]
math floor (an)  [RTS]
math gcd (tup)  [TAVLIB.TAV]
math int sqrt (n)  [MATH]
math int (arg) count digits (base)  [MATH]
math int (n) is square  [TAVLIB.TAV]
math int (e) root (n)  [TAVLIB.TAV]
math lg (arg)  [MATH]
math log (arg)  [MATH]
math round (an)  [RTS]
math sign (item)  [RTS]
math sin (arg)  [MATH]
math sqrt (arg)  [MATH]
math tan (arg)  [MATH]
math trunc (an)  [RTS]
math wide (an)  [RTS]

matrix

new matrix size (dimensions)  [MATRIX.TAV]
new matrix size (dimensions) origin (origin)  [MATRIX.TAV]
matrix (@) give keys  [MATRIX.TAV]
matrix (@) print  [MATRIX.TAV]

maximum

maximum of (trm)  [TAVLIB.TAV]

minimum

minimum of (trm)  [TAVLIB.TAV]

network

network url (url) give lines  [TAVLIB.TAV]

pad

pad left (mixed) to (len)  [RTSTAV.TAV]
pad left (mixed) to (len) by (chr)  [RTSTAV.TAV]
pad left (len) (str)  [RTSTAV.TAV]
pad right (mixed) to (len)  [RTSTAV.TAV]
pad right (mixed) to (len) by (chr)  [RTSTAV.TAV]
pad right (len) (str)  [RTSTAV.TAV]
pad (len) (str)  [RTSTAV.TAV]

print

print (mixed)  [STRINGS]
print (mixed) nonl  [STRINGS]

quote

quote (string)  [TAVLIB.TAV]

random

random next float  [TAVLIB.TAV]
random next integer  [RTS]
random next integer noisy  [CRYPTO]
random set seed (seed)  [RTS]

rational

rational (this) as dfloat (p)  [DFLOAT.TAV]
rational (@) as float  [RTS]
rational (@) as string  [STRINGS]
rational (@) hash  [RTS]

row

new row  [RTS]
new row size (cells)  [RTS]
new row (tagname)  [TAVLIB.TAV]
new row (tagname) size (sz)  [TAVLIB.TAV]
new row using (func) with (arg)  [RTSTAV.TAV]
new row using (func) with (arg1) (arg2)  [RTSTAV.TAV]
row (@) append (rmt)  [TAVLIB.TAV]
row (@) as map  [TAVLIB.TAV]
row (@) as tuple  [RTS]
row (@) compact  [TAVLIB.TAV]
row (@) copy  [TAVLIB.TAV]
row (@) copy lean  [TAVLIB.TAV]
row (@) dedup  [TAVLIB.TAV]
row (@) dedup bursts  [TAVLIB.TAV]
row (@) dedup using (func)  [TAVLIB.TAV]
row (@) dedup using (func) with (extra)  [TAVLIB.TAV]
row (@) find (val)  [TAVLIB.TAV]
row (@) find (val) all  [TAVLIB.TAV]
row (@) from (from) upto (upto)  [TAVLIB.TAV]
row (@) give keys  [RTS]
row (@) give values  [RTS]
row (@) join keys by (sep)  [TAVLIB.TAV]
row (@) join values as string  [TAVLIB.TAV]
row (@) join values by (sep)  [TAVLIB.TAV]
row (@) keys  [TAVLIB.TAV]
row (@) lock  [RTS]
row (@) max  [TAVLIB.TAV]
row (@) min  [TAVLIB.TAV]
row (@) parse options values (valopts)  [TAVLIB.TAV]
row (@) pop  [TAVLIB.TAV]
row (@) push (val)  [TAVLIB.TAV]
row (@) sort ascending  [RTS]
row (@) sort descending  [RTS]
row (@) sort fast ascending  [RTS]
row (@) sort fast descending  [RTS]
row (@) sort fast using (func)  [RTS]
row (@) sort fast using (func) with (extra)  [RTS]
row (@) sort pairs (n) ascending  [TAVLIB.TAV]
row (@) sort pairs (n) descending  [TAVLIB.TAV]
row (@) sort sync (val) ascending  [RTS]
row (@) sort sync (val) descending  [RTS]
row (@) sort sync (val) using (func)  [RTS]
row (@) sort using (func)  [RTS]
row (@) sort using (func) with (extra)  [RTS]
row (@) stow (rmt)  [TAVLIB.TAV]
row (@) unlock  [RTS]
row (@) values  [TAVLIB.TAV]

sax

new sax parser (ctx)  [XML.TAV]
sax (this) supply (str)  [XML.TAV]

sort

sort (row) ascending  [RTS]
sort (row) descending  [RTS]
sort (row) fast ascending  [RTS]
sort (row) fast descending  [RTS]
sort (row) fast using (func)  [RTS]
sort (row) sync (val) ascending  [RTS]
sort (row) sync (val) descending  [RTS]
sort (row) sync (val) using (func)  [RTS]
sort (row) using (func)  [RTS]

string

string (string) as MD5 chunk  [CRYPTO]
string (string) as MD5 compact  [CRYPTO]
string (string) as MD5 hex  [CRYPTO]
string (string) as SHA1 chunk  [CRYPTO]
string (string) as SHA1 compact  [CRYPTO]
string (string) as SHA1 hex  [CRYPTO]
string (@) as character row  [TAVLIB.TAV]
string (this) as dfloat  [DFLOAT.TAV]
string (this) as dfloat ignore (ign)  [DFLOAT.TAV]
string (@) as float  [STRINGS]
string (@) as float else (default)  [TAVLIB.TAV]
string (@) as integer  [TAVLIB.TAV]
string (@) as integer base (basespec)  [TAVLIB.TAV]
string (@) as integer clib (base)  [STRINGS]
string (@) as integer decimal  [TAVLIB.TAV]
string (@) as integer else (default)  [TAVLIB.TAV]
string (@) as integer ignore (ign)  [TAVLIB.TAV]
string (@) as integer ignore (ign) else (repl)  [TAVLIB.TAV]
string (@) as integer literal  [TAVLIB.TAV]
string (@) case flipped  [TAVLIB.TAV]
string (@) case is lower  [TAVLIB.TAV]
string (@) case is upper  [TAVLIB.TAV]
string (@) case starts lower  [STRINGS]
string (@) case starts upper  [STRINGS]
string (@) case to lower  [STRINGS]
string (@) case to upper  [STRINGS]
string (@) check ascii  [STRINGS]
string (@) code point at (pos)  [STRINGS]
string (@) count from (start) many of (accept)  [TAVLIB.TAV]
string (@) count from (start) none of (reject)  [TAVLIB.TAV]
string (@) decode percent encoding  [STRINGS]
string (@) encode numeric entities  [TAVLIB.TAV]
string (key) encrypt salt (salt)  [CRYPTO]
string (@) from (first)  [STRINGS]
string (@) from (pos) has (what)  [TAVLIB.TAV]
string (@) from (first) length (len)  [STRINGS]
string (@) from (start) length (len) step (step)  [STRINGS]
string (@) from (start) many of (accept)  [TAVLIB.TAV]
string (@) from (start) none of (reject)  [TAVLIB.TAV]
string (@) from (first) upto (last)  [STRINGS]
string (@) give characters  [TAVLIB.TAV]
string (@) give clips by any of (sep)  [TAVLIB.TAV]
string (@) give clips by many of (seps)  [TAVLIB.TAV]
string (@) give clips by (seps)  [TAVLIB.TAV]
string (@) group  [TAVLIB.TAV]
string (@) group (gm)  [TAVLIB.TAV]
string (@) has character (c)  [TAVLIB.TAV]
string (@) has head (head)  [TAVLIB.TAV]
string (@) has tail (tail)  [TAVLIB.TAV]
string (@) hash  [STRINGS]
string (@) is ascii  [RTS]
string (@) is localized  [RTS]
string (@) is raw  [RTS]
string (@) localize  [RTSTAV.TAV]
string (@) locate (needle)  [STRINGS]
string (@) locate (needle) from (start)  [STRINGS]
string (@) matches filename (pattern)  [INOUT]
string (@) pad left to (len) by (chr)  [RTSTAV.TAV]
string (@) pad right to (len) by (chr)  [RTSTAV.TAV]
string (@) parse query  [TAVLIB.TAV]
string (@) quote for shell  [TAVLIB.TAV]
string (@) quoted  [TAVLIB.TAV]
string (@) replace at (pos) by (repl)  [TAVLIB.TAV]
string (@) replace character at (pos) by (repl)  [TAVLIB.TAV]
string (@) replace each of (cue) by (repl)  [TAVLIB.TAV]
string (@) replace each (cue) by (repl)  [TAVLIB.TAV]
string (@) replace first (cue) by (repl)  [TAVLIB.TAV]
string (@) replace from (from) upto (upto) by (repl)  [TAVLIB.TAV]
string (@) replace many (pairs)  [TAVLIB.TAV]
string (@) split by any of (seps)  [TAVLIB.TAV]
string (@) split by many of (seps)  [TAVLIB.TAV]
string (@) split by (seps)  [TAVLIB.TAV]
string (@) times (ni)  [STRINGS]
string (@) untab (ts)  [TAVLIB.TAV]
string (@) upto (last)  [STRINGS]
string (@) without head (head)  [TAVLIB.TAV]
string (@) without leading whitespace  [TAVLIB.TAV]
string (@) without leading (chars)  [TAVLIB.TAV]
string (@) without trailing whitespace  [TAVLIB.TAV]
string (@) without trailing (chars)  [TAVLIB.TAV]
string (@) wrap (wrap)  [TAVLIB.TAV]

system

system clock microseconds  [RTSTAV.TAV]
system clock seconds  [RTSTAV.TAV]
system clock (which)  [RTS]
system command (cmd)  [RTS]
system cpu microseconds  [RTSTAV.TAV]
system cpu seconds  [RTSTAV.TAV]
system cpu times  [RTS]
system current directory  [INOUT]
system epoch seconds  [RTS]
system exit (retcode)  [RTS]
system fault mode (fm)  [RTS]
system get environment  [RTS]
system get environment (key)  [TAVLIB.TAV]
system get locale  [RTS]
system get locale numeric  [RTS]
system hash (any)  [RTS]
system info disable  [RTS]
system info enable  [RTS]
system on exit call (funcref) using (parm)  [TAVLIB.TAV]
system on exit remove (funcref)  [TAVLIB.TAV]
system process fork  [RTS]
system process kill (pn)  [RTS]
system process kill (pn) with (signo)  [RTS]
system process own id  [RTS]
system process wait  [RTS]
system set locale  [RTS]
system set locale (cat) to (val)  [RTS]
system set string (str) IsL10n  [RTS]
system signal on interrupt (funcref)  [RTS]
system sleep (seconds)  [RTS]
system standard error  [INOUT]
system standard input  [INOUT]
system standard output  [INOUT]

terminal

terminal prompt (prompt)  [INOUT]
terminal read line (prompt)  [READLINE]

time

time (seconds) format (fmt)  [RTS]
time (seconds) unpack as map  [RTS]
time (seconds) unpack local as map  [RTS]

tuple

new tuple size (count) values (vals)  [RTS]
new tuple using (func) with (arg)  [RTSTAV.TAV]
new tuple using (func) with (arg1) (arg2)  [RTSTAV.TAV]
tuple (@) add (x)  [RTSTAV.TAV]
tuple (@) append (val)  [TAVLIB.TAV]
tuple (@) apply (func)  [RTSTAV.TAV]
tuple (@) as map  [RTSTAV.TAV]
tuple (@) as row  [RTSTAV.TAV]
tuple (@) as string  [RTSTAV.TAV]
tuple (@) as string parenthesized  [RTSTAV.TAV]
tuple (p) equal (q) cell (n)  [TAVLIB.TAV]
tuple (@) find (val)  [TAVLIB.TAV]
tuple (@) from (from) upto (upto)  [TAVLIB.TAV]
tuple (@) give keys  [RTS]
tuple (@) give values  [RTS]
tuple (p) greater (q) cell (n)  [TAVLIB.TAV]
tuple (@) hash  [RTSTAV.TAV]
tuple (@) inverse  [RTSTAV.TAV]
tuple (p) less (q) cell (n)  [TAVLIB.TAV]
tuple (@) max  [TAVLIB.TAV]
tuple (@) min  [TAVLIB.TAV]
tuple (@) multiply (x)  [RTSTAV.TAV]
tuple (@) negate  [RTSTAV.TAV]
tuple (@) subtract (x)  [RTSTAV.TAV]

Deprecated

abs (item)  [RTS]
as clib integer (str)  [STRINGS]
as integer (str) clib (base)  [STRINGS]
as map pairs (tup)  [TAVLIB.TAV]
as map row (row)  [TAVLIB.TAV]
as map string pairs (str)  [TAVLIB.TAV]
as map tuple pairs (tup)  [TAVLIB.TAV]
attributes of file (filename)  [INOUT]
bytes of (item)  [RTS]
call function (func) using (parm)  [RTS]
call function (func) using (parm1) and (parm2)  [RTS]
call function (func) using (parm1) and (parm2) and (parm3)  [RTS]
call (func) using (parm)  [RTS]
call (func) using (parm1) and (parm2)  [RTS]
call (func) using (parm1) and (parm2) and (parm3)  [RTS]
call (func) with (parm)  [RTS]
call (func) with (parm1) and (parm2)  [RTS]
call (func) with (parm1) and (parm2) and (parm3)  [RTS]
ceil (an)  [RTS]
cformat (format) number (num)  [STRINGS]
cformat (format) (num)  [STRINGS]
clip (src) from (first)  [STRINGS]
clip (src) from (first) length (len)  [STRINGS]
clip (src) from (first) upto (last)  [STRINGS]
clip (src) upto (last)  [STRINGS]
clip (str) without leading whitespace  [TAVLIB.TAV]
clip (str) without leading (chars)  [TAVLIB.TAV]
clip (str) without trailing whitespace  [TAVLIB.TAV]
clip (str) without trailing (chars)  [TAVLIB.TAV]
command (cmd) row of lines  [TAVLIB.TAV]
encrypt password (key) with salt (salt)  [CRYPTO]
new fault code (code) message (msg)  [RTS]
file (filename) get attributes  [INOUT]
file (filename) row of lines  [TAVLIB.TAV]
first key (row)  [RTS]
get environment value of (key)  [TAVLIB.TAV]
give filenames of directory (dir)  [TAVLIB.TAV]
give lines from file (filename)  [TAVLIB.TAV]
give lines from standard input  [TAVLIB.TAV]
give lines of command (cmd)  [TAVLIB.TAV]
give (bunch) values  [RTS]
group (str)  [TAVLIB.TAV]
group (str) by (gm)  [TAVLIB.TAV]
integer from (str) base (base)  [STRINGS]
integer (an)  [RTS]
is character (c) in string (str)  [TAVLIB.TAV]
is input a tty  [INOUT]
is output a tty  [INOUT]
is string (str) ascii  [RTS]
has string (str) character (c)  [TAVLIB.TAV]
is string (tail) ending (str)  [TAVLIB.TAV]
is string (head) head of (str)  [TAVLIB.TAV]
has string (str) head (head)  [TAVLIB.TAV]
is string (key) in (tgt) from (pos)  [TAVLIB.TAV]
is string (str) raw  [RTS]
is string (head) starting (str)  [TAVLIB.TAV]
is string (tail) tail of (str)  [TAVLIB.TAV]
item (num) as string  [STRINGS]
item (itm) count  [RTS]
last key (row)  [RTS]
map (@) compact  [RTS]
map (@) join keys by (sep)  [TAVLIB.TAV]
map (@) key (key) add (value) unchecked  [RTS]
math is big (an)  [RTS]
max of (trm)  [TAVLIB.TAV]
max (vals)  [TAVLIB.TAV]
min of (trm)  [TAVLIB.TAV]
min (vals)  [TAVLIB.TAV]
number (num) as string  [STRINGS]
parse query string (str)  [TAVLIB.TAV]
print partial (mixed)  [STRINGS]
replace each (cue) by (repl) in string (target)  [TAVLIB.TAV]
row of filenames from directory (dir)  [TAVLIB.TAV]
row of lines from command (cmd)  [TAVLIB.TAV]
row of lines from file (filename)  [TAVLIB.TAV]
row (r) clone  [TAVLIB.TAV]
row (@) dedup sorted  [TAVLIB.TAV]
row (@) shrink  [TAVLIB.TAV]
runtime statistics enable  [RTS]
seconds cpu time  [RTS]
seconds since epoch  [RTS]
sign (item)  [RTS]
sleep (seconds) seconds  [RTS]
string (@) as map by pairs  [TAVLIB.TAV]
string (str) clip from (first)  [STRINGS]
string (str) clip from (first) length (len)  [STRINGS]
string (str) clip from (start) many of (accept)  [TAVLIB.TAV]
string (str) clip from (start) none of (reject)  [TAVLIB.TAV]
string (str) clip from (first) upto (last)  [STRINGS]
string (str) clip upto (last)  [STRINGS]
string (@) in lower case  [STRINGS]
string (@) in upper case  [STRINGS]
string (@) starts lower case  [STRINGS]
string (@) starts upper case  [STRINGS]
system cformat (format) (num)  [STRINGS]
tag (item) by (tag)  [RTS]
tuple (tup) as map by pairs  [TAVLIB.TAV]

Class functions

Classes:

basic pipe, command stream, directory stream, fault, file stream, float, integer, is, map, matrix, rational, row, string, tuple
add (x)::
tuple (@) add (x)
add pairs (rmt)::
map (@) add pairs (rmt)
append (line) atomically::
file stream (@) append (line) atomically
append (rmt)::
row (@) append (rmt)
append (val)::
tuple (@) append (val)
apply (func)::
tuple (@) apply (func)
as character row::
string (@) as character row
as float::
integer (@) as float
rational (@) as float
string (@) as float
as float else (default)::
string (@) as float else (default)
as integer::
float (@) as integer
string (@) as integer
as integer base (basespec)::
string (@) as integer base (basespec)
as integer clib (base)::
string (@) as integer clib (base)
as integer decimal::
string (@) as integer decimal
as integer else (default)::
string (@) as integer else (default)
as integer ignore (ign)::
string (@) as integer ignore (ign)
as integer ignore (ign) else (repl)::
string (@) as integer ignore (ign) else (repl)
as integer literal::
string (@) as integer literal
as map::
tuple (@) as map
row (@) as map
as map by pairs::
string (@) as map by pairs
as row::
tuple (@) as row
as string::
tuple (@) as string
float (@) as string
integer (@) as string
rational (@) as string
as string (d)::
float (@) as string (d)
as string base (basespec)::
integer (@) as string base (basespec)
as string digits (d)::
float (@) as string digits (d)
as string fixed (d)::
float (@) as string fixed (d)
as string key (delim) join (sep) quote (qr)::
map (@) as string key (delim) join (sep) quote (qr)
as string parenthesized::
tuple (@) as string parenthesized
as string strict (d)::
float (@) as string strict (d)
as tuple::
row (@) as tuple
case flipped::
string (@) case flipped
case is lower::
string (@) case is lower
case is upper::
string (@) case is upper
case starts lower::
string (@) case starts lower
case starts upper::
string (@) case starts upper
case to lower::
string (@) case to lower
case to upper::
string (@) case to upper
check ascii::
string (@) check ascii
close::
file stream (@) close
command stream (@) close
directory stream (@) close
close reading::
basic pipe (@) close reading
close writing::
basic pipe (@) close writing
code point at (pos)::
string (@) code point at (pos)
compact::
map (@) compact
row (@) compact
copy::
row (@) copy
map (@) copy
copy lean::
row (@) copy lean
map (@) copy lean
count from (start) many of (accept)::
string (@) count from (start) many of (accept)
count from (start) none of (reject)::
string (@) count from (start) none of (reject)
decode percent encoding::
string (@) decode percent encoding
dedup::
row (@) dedup
dedup bursts::
row (@) dedup bursts
dedup sorted::
row (@) dedup sorted
dedup using (func)::
row (@) dedup using (func)
dedup using (func) with (extra)::
row (@) dedup using (func) with (extra)
encode numeric entities::
string (@) encode numeric entities
fault backtrace::
is (@) fault backtrace
fault stop::
is (@) fault stop
find (val)::
row (@) find (val)
tuple (@) find (val)
map (@) find (val)
find (val) all::
row (@) find (val) all
map (@) find (val) all
flush::
file stream (@) flush
from (first)::
string (@) from (first)
from (first) length (len)::
string (@) from (first) length (len)
from (first) upto (last)::
string (@) from (first) upto (last)
from (from) upto (upto)::
row (@) from (from) upto (upto)
tuple (@) from (from) upto (upto)
from (pos) has (what)::
string (@) from (pos) has (what)
from (start) length (len) step (step)::
string (@) from (start) length (len) step (step)
from (start) many of (accept)::
string (@) from (start) many of (accept)
from (start) none of (reject)::
string (@) from (start) none of (reject)
get::
file stream (@) get
command stream (@) get
directory stream (@) get
basic pipe (@) get
give characters::
string (@) give characters
give clips by (seps)::
string (@) give clips by (seps)
give clips by any of (sep)::
string (@) give clips by any of (sep)
give clips by many of (seps)::
string (@) give clips by many of (seps)
give keys::
row (@) give keys
map (@) give keys
tuple (@) give keys
matrix (@) give keys
give keys ascending::
map (@) give keys ascending
give keys ascending values::
map (@) give keys ascending values
give keys descending::
map (@) give keys descending
give keys descending values::
map (@) give keys descending values
give keys using (func)::
map (@) give keys using (func)
give keys using (func) with (extra)::
map (@) give keys using (func) with (extra)
give pairs::
map (@) give pairs
give values::
row (@) give values
tuple (@) give values
map (@) give values
group::
string (@) group
group (gm)::
string (@) group (gm)
has character (c)::
string (@) has character (c)
has head (head)::
string (@) has head (head)
has tail (tail)::
string (@) has tail (tail)
hash::
integer (@) hash
rational (@) hash
tuple (@) hash
string (@) hash
hashed::
map (@) hashed
in lower case::
string (@) in lower case
in upper case::
string (@) in upper case
inverse::
tuple (@) inverse
invert::
map (@) invert
is ascii::
string (@) is ascii
is localized::
string (@) is localized
is raw::
string (@) is raw
join keys by (sep)::
row (@) join keys by (sep)
map (@) join keys by (sep)
join values as string::
row (@) join values as string
join values by (sep)::
row (@) join values by (sep)
map (@) join values by (sep)
key (key) add (value) unchecked::
map (@) key (key) add (value) unchecked
key by value (val)::
map (@) key by value (val)
keys::
map (@) keys
row (@) keys
keys as row::
map (@) keys as row
keys by value (val)::
map (@) keys by value (val)
localize::
string (@) localize
locate (needle)::
string (@) locate (needle)
locate (needle) from (start)::
string (@) locate (needle) from (start)
lock::
row (@) lock
map (@) lock
mark checked::
fault (@) mark checked
matches filename (pattern)::
string (@) matches filename (pattern)
max::
tuple (@) max
row (@) max
map (@) max
min::
tuple (@) min
row (@) min
map (@) min
multiply (x)::
tuple (@) multiply (x)
negate::
tuple (@) negate
pad left to (len) by (chr) ::
string (@) pad left to (len) by (chr)
pad right to (len) by (chr)::
string (@) pad right to (len) by (chr)
pairs key value::
map (@) pairs key value
pairs value key::
map (@) pairs value key
parse options values (valopts)::
row (@) parse options values (valopts)
parse query::
string (@) parse query
pop::
row (@) pop
print::
fault (@) print
matrix (@) print
print backtrace::
fault (@) print backtrace
print stop::
fault (@) print stop
push (val)::
row (@) push (val)
put (str)::
basic pipe (@) put (str)
put (string)::
file stream (@) put (string)
command stream (@) put (string)
quote for shell::
string (@) quote for shell
quoted::
string (@) quoted
replace at (pos) by (repl)::
string (@) replace at (pos) by (repl)
replace character at (pos) by (repl)::
string (@) replace character at (pos) by (repl)
replace each (cue) by (repl)::
string (@) replace each (cue) by (repl)
replace each of (cue) by (repl)::
string (@) replace each of (cue) by (repl)
replace first (cue) by (repl)::
string (@) replace first (cue) by (repl)
replace from (from) upto (upto) by (repl)::
string (@) replace from (from) upto (upto) by (repl)
replace many (pairs)::
string (@) replace many (pairs)
seek (loc)::
file stream (@) seek (loc)
shrink::
row (@) shrink
sort ascending::
row (@) sort ascending
sort descending::
row (@) sort descending
sort fast ascending::
row (@) sort fast ascending
sort fast descending::
row (@) sort fast descending
sort fast using (func)::
row (@) sort fast using (func)
sort fast using (func) with (extra)::
row (@) sort fast using (func) with (extra)
sort pairs (n) ascending::
row (@) sort pairs (n) ascending
sort pairs (n) descending::
row (@) sort pairs (n) descending
sort sync (val) ascending ::
row (@) sort sync (val) ascending
sort sync (val) descending ::
row (@) sort sync (val) descending
sort sync (val) using (func)::
row (@) sort sync (val) using (func)
sort using (func)::
row (@) sort using (func)
sort using (func) with (extra)::
row (@) sort using (func) with (extra)
split by (seps)::
string (@) split by (seps)
split by any of (seps)::
string (@) split by any of (seps)
split by many of (seps)::
string (@) split by many of (seps)
starts lower case::
string (@) starts lower case
starts upper case::
string (@) starts upper case
stow (rmt)::
row (@) stow (rmt)
subtract (x)::
tuple (@) subtract (x)
tell::
file stream (@) tell
times (ni)::
string (@) times (ni)
unlock::
row (@) unlock
map (@) unlock
untab (ts)::
string (@) untab (ts)
upto (last)::
string (@) upto (last)
value key pairs as row::
map (@) value key pairs as row
values::
map (@) values
row (@) values
values as row::
map (@) values as row
without head (head)::
string (@) without head (head)
without leading (chars)::
string (@) without leading (chars)
without leading whitespace::
string (@) without leading whitespace
without trailing (chars)::
string (@) without trailing (chars)
without trailing whitespace::
string (@) without trailing whitespace
wrap (wrap)::
string (@) wrap (wrap)

Documentation

TAVPL_rts.c

system signal on interrupt (funcref)  [RTS]
Register a SIGINT callback
which returns the previous setting (may be void).

The function is called with an fault item as argument
and may return either void or a fault item.
In the latter case, the fault item is injected to stop any loop
and replaces the next function return.
If unprocessed, it is a fatal runtime error;
else it is simply dropped.

error dump used items  [RTS]
print a dump of all used items to stderr

item (itm) count  [RTS] Deprecated.
Supply the number of elements (row, map, tuple),
bytes (chunk), characters (code points, string).
Same as attribute .Count
Usful e.g. as (count of num _ '') to give the number of digits

bytes of (item)  [RTS] Deprecated.
Supply the number of bytes used
Not required for expressions, use attribute .Bytes

math abs (item)  [RTS]
Absolute value of a number

abs (item)  [RTS] Deprecated.
Alias for 'math abs ()'

math sign (item)  [RTS]
Sign of a number
Void if not a number
Same kind as input if not void

sign (item)  [RTS] Deprecated.
Alias for 'math sign ()'

string (@) is raw  [RTS]
Is string a raw string

is string (str) raw  [RTS] Deprecated.
Alias for 'string () is raw'

string (@) is ascii  [RTS]
Is string an ASCII string

string (@) is localized  [RTS]
Is string a localized string

is string (str) ascii  [RTS] Deprecated.
Alias for 'string () is ascii'

last key (row)  [RTS] Deprecated.
Last key of a row; same as .last

first key (row)  [RTS] Deprecated.
First key of a row; same as .first

is (x) fault  [RTS]
True if item is a fault item

fault (@) mark checked  [RTS]
Increase acknowledge count of an error item.
Same as x.checked =+ 1
Fatal if not a fault

integer (@) hash  [RTS]
Simple hash for integers using Knuth's method.
 returns x*1327217881 %% 2^31

rational (@) hash  [RTS]
Simple hash for rationals.
 returns the hash of the sum of numerator and denominator

system hash (any)  [RTS]
Systsem provided hash for any item
 Integers are hashed with  x*1327217881 %% 2^31
 Rationals hash the sum of numerator and denominator
 Strings are hashed by "string (x) hash"
 Tuples are hashed by "tuple (x) hash"
 Floats cannot be hashed, because there is no equality
 All others hash the memory address of the item.
 Void returns void (not zero)

tag (item) by (tag)  [RTS] Deprecated.
Set tag attribute
 Not required for expressions, set control field .Tag

bunch (bunch) lock  [RTS]
Increase the lock count of a row or map.
When the lock count is not zero, the item becomes temporarily immutable.

row (@) lock  [RTS]
Increase the lock count of a row.
When the lock count is not zero, the item becomes temporarily immutable.

map (@) lock  [RTS]
Increase the lock count of a map.
When the lock count is not zero, the item becomes temporarily immutable.

bunch (bunch) unlock  [RTS]
Decrease the lock count of a row or map.
If the lock count is still not zero, the item is still immutable.
If the lock count was zero, it is not changed, but a fault item returned.

row (@) unlock  [RTS]
Decrease the lock count of a row.
If the lock count is still not zero, the item is still immutable.
If the lock count was zero, it is not changed, but a fault item returned.

map (@) unlock  [RTS]
Decrease the lock count of a map.
If the lock count is still not zero, the item is still immutable.
If the lock count was zero, it is not changed, but a fault item returned.

chunk (chunk) set byteorder (char)  [RTS]
Set byte order attribute in chunks

system set string (str) IsL10n  [RTS]
provide a string with the attribte .Isl10n set
If it is used nowhere else, the flag is set;
otherwise the string is copied and the flag set.

is (x) void  [RTS]
check if void; same as x = ()

is (x) invalid  [RTS]
check if invalid

is (x) proxy  [RTS]
check if proxy

is (x) boolean  [RTS]
check if boolean; same as x.kind = 'boolean'

is (x) integer  [RTS]
check if integer (x.kind = 'integer')

is (x) rational  [RTS]
check if rational (x.kind = 'rational')

is (x) float  [RTS]
check if float; same as x.kind = 'float'

is (x) number  [RTS]
check if number, i.e. is integer, is rational or is float

is (x) string  [RTS]
check if string; same as x .= '' or x.kind = 'string'

is (x) row  [RTS]
check if row; same as x.kind = 'row'

is (x) map  [RTS]
check if map; same as x .= {} or x.kind = 'map'

is (x) chunk  [RTS]
check if chunk; same as x.kind = 'chunk'

is (x) function  [RTS]
check if function; same as x.kind = 'function'

is (x) tuple  [RTS]
check if tuple; same as x.kind = 'tuple'

is (x) odd  [RTS]
Test if integer is odd:
 :> x %% 2 = 1
 Returns boolean, not integer (use x %% 2 to obtain an integer)

is (x) even  [RTS]
Test if integer is even:
 :> x %% 2 = 0
 Returns boolean, not integer (use x %% 2 to obtain an integer)

bits (x) is (n) set  [RTS]
Test the n-th bit of an integer number (0 origin).
 Multiprecision (big) numbers are allowed.
 Negative targets are possible and treated as in two's complement,
 Returns boolean, not integer (use (x // 2^n) %% 2 to obtain an integer)

bits (x) and (y)  [RTS]
Bitwise multiplication (AND) on machine integers.
 Negative targets are tolerated and treated as in two's complement.

bits (x) or (y)  [RTS]
Bitwise multiplication (OR) on machine integers.
 Negative targets are tolerated and treated as in two's complement.

bits (x) xor (y)  [RTS]
Bitwise addition (XOR) on machine integers.
 Negative targets are tolerated and treated as in two's complement.

bits (x) invert  [RTS]
Bit inversion (one's complement) on machine integers.
 Negative targets are tolerated and treated as two's complement.

bits (x) shift (n)  [RTS]
Bit shift on machine integers.
 Negative targets and counts larger machine integer bits (63) are erroneous.

 n>0 is shift left; result is modulo $SYSTEM.intmax//2
 n<0 is shift right; integer truncation division.
 n=0 (or void) returns the argument unchanged.

 Do not use shifts as purportedly more efficient than multiplications;
 they are not, unsafe and only obscuring code.
 Better use x * 2^n or x // 2^n, if this is it.

new row  [RTS]
new empty row factory function
 Should never fail with a fatal runtime error.
 See: new row size ()

new row size (cells)  [RTS]
new row factory function
 Create a new row with minimum number of pre-allocated cells.

 A fault item may be returned on failure.

 Note that many operating systems use optimistic allocation
 and may return success, but kill the process later
 if memory is really exhausted.

row (@) give keys  [RTS]
Scan gives keys (indices) of non-void row elements
The row may be modified or even another one while scanned;
just the keys are enumerated and void cells skipped.
The range of keys is fixed on the first call (like a map).
To deliver all keys, use: from row.first upto row.last

row (@) give values  [RTS]
Scan gives actual values of a row
 from keys as given by 'row () give keys'.
 Thus void entries are not supplied.

row (@) sort fast using (func) with (extra)  [RTS]
Sort the values in a row (vector) using the C library routine.
 Same as 'row () sort fast using ()':
 but optionally providing the compare function
 with a third argument (extra), if not void.

row (@) sort fast using (func)  [RTS]
Sort the values in a row (vector) using the C library routine.
If the compare funtion reference (func) is void,
the TAV operator '>' is used for ascending numbers or strings.
Otherwise it must be a function reference that returns:
    ?+  if a is "greater" than b
    = 0 if a is "equal" to b
    ?-  otherwise
Sort may be unstable, i.e. changing the order of equal items;
for a stable sort use 'row (@) sort ascending using (func)'
The row reference is returned.
The indices remain, i.e. .Last and .First are unchanged,
just the values are sorted.

sort (row) fast using (func)  [RTS]
Alias for: row (@) sort fast using ()

row (@) sort fast ascending  [RTS]
Sort the values of a row ascending using the C library routine.
 Shortcut for 'row (@) sort fast using ()'

row (@) sort fast descending  [RTS]
Sort the values of a row descending using the C library routine.

sort (row) fast ascending  [RTS]
Alias for: row (@) sort fast ascending

sort (row) fast descending  [RTS]
Alias for: row (@) sort fast descending

row (@) sort using (func)  [RTS]
Sort a row (vector) in place using a compare function.
 If the compare function (func) is void,
 the standard TAV operator '>' is used giving ascending values.
 Otherwise, it must be a function reference that returns an integer
     > 0 for a > b
     = 0 for a = b
     < 0 for a < b
 Method used is in-place insert sort, which has low overhead
 for small sets and moderate speed for larger sets,
 and is stable, i.e. keeps the order of equal elements.
 For large sets (>10000) use e.g. row (@) sort fast using (func).
 The row reference is returned.

sort (row) using (func)  [RTS]
Alias for: row (@) sort using (func)

row (@) sort using (func) with (extra)  [RTS]
Sort a row (vector) in place using a compare function.
 Same as 'row () sort using ()', but provides a third (user)
 parameter to the compare function.

row (@) sort ascending  [RTS]
Sort a row (vector) ascending.
 Shortcut for: row (@) sort using ()

sort (row) ascending  [RTS]
Alias for: row (@) sort ascending

row (@) sort descending  [RTS]
Sort a row (vector) descending.
 See 'row (@) sort using (func)'
 but using '<' instead of '>'

sort (row) descending  [RTS]
Alias for: row (@) sort descending

row (@) sort sync (val) using (func)  [RTS]
Sort a row (vector), and keep a second row (val) synchronous.
 Avoids the use of pairs to be sorted.
 Uses insert sort and might be slower than using fast sort with pairs.
 See "row (@) sort using (func)"

sort (row) sync (val) using (func)  [RTS]
Alias for: row (@) sort sync (val) using (func)

row (@) sort sync (val) ascending  [RTS]
Shortcut for: row (@) sort sync (val) using ()

sort (row) sync (val) ascending  [RTS]
Alias for: row (@) sort sync (val) ascending

row (@) sort sync (val) descending  [RTS]
Shortcut for: row (@) sort sync (val) using ()
but with inverted compare

sort (row) sync (val) descending  [RTS]
Alias for: row (@) sort sync (val) descending

new map  [RTS]
new map factory function
 Create a new map

map (@) hashed  [RTS]
preliminary: convert to a hashed map

map (@) key (key) add (value) unchecked  [RTS] Deprecated.
Quickly add element to a map allowing duplicates.
 The element is added without searching for the key,
 hiding, but not removing any previously set value.
 If the value is void, the most recent one is deleted,
 as with the ordinay map access.
 Use may increase, but improper use may degrade performance.
 No longer useful as hashed maps have the same perfomance.

map (@) keys  [RTS]
Provide the keys of a map as a row.
 Order is undefined, usually last used first.
 Keys are unique.

map (@) keys as row  [RTS]
Alias of: map () keys

map (@) values  [RTS]
Provide the values of a map as a row.
 Order is usually last used first.
 Because keys may have the same value,
 the values provided are in general not unique.

map (@) values as row  [RTS]
Alias of: map () values

map (@) pairs key value  [RTS]
Provide keys and their values as a row of pairs.
 Key order is undefined, but keys are unique.

map (@) pairs value key  [RTS]
Provide values and their keys as a row of pairs.
 Order is undefined, but keys are unique.

map (@) give keys  [RTS]
Scan to provide the keys of a map unsorted.
 The keys are saved at the first call, so it is equivalent to:
     mr =: map (m) keys
     ?# key =: row mr give values    \ row values are the map keys
         :> key

map (@) compact  [RTS] Deprecated.
Remove all duplicate keys and their values in a map.
If the map is already marked with .UniqueKeys,
returns immediately.
Returns void.

row (@) as tuple  [RTS]
Create a tuple dynamically and fill it with row elements,
 Void elements are retained to keep the set of keys

new tuple size (count) values (vals)  [RTS]
New tuple with all elements equal.
 If one with diferent values is needed, use: row (@) as tuple

tuple (@) give keys  [RTS]
Scann to provide keys of a tuple (ascending)
 In contrast to rows, all keys are returned, even if the value is void

tuple (@) give values  [RTS]
Scan to provide values of a tuple in ascending index order.
 In contrast to rows, void values are not suppressed

give keys (bunch)  [RTS]
Lazy scan that uses '{row, map, tuple} (rmt) give keys'
by determining the kind on the fly

bunch (bunch) give keys  [RTS]
Lazy scan that uses '{row, map, tuple} (rmt) give values'
by determining the kind on the fly
No fault, only void return if neither row, map or tuple

bunch (bunch) give values  [RTS]
Lazy scan that uses '{row, map, tuple} (rmt) give values'
by determining the kind on the fly
No fault, only void return if neither row, map or tuple

give values (bunch)  [RTS]
Alias for bunch (bunch) give values

give (bunch) values  [RTS] Deprecated.
Alias for bunch (bunch) give values

integer (an)  [RTS] Deprecated.
Truncate floating point to nearest integer (.int)

math trunc (an)  [RTS]
Truncate number to nearest integer (.int)

math round (an)  [RTS]
Round floating pointto nearest integer (.round)

math ceil (an)  [RTS]
Smallest integer greater or equal (.ceil)

ceil (an)  [RTS] Deprecated.
Deprecated for 'math ceil ()'

math floor (an)  [RTS]
Largest integer less or equal (.floor)

math wide (an)  [RTS]
round away from zero (.wide)

math float (x)  [RTS]
Convert accurate (integer or rational) to approximate (floating point) number.
Same as .float attribute or ## operator.
Returns a copy if already a float.
Returns 0.0 if void.
No runtime errors, just void if not a number.

integer (@) as float  [RTS]
Alias for: math float ()

rational (@) as float  [RTS]
Alias for: math float ()

is (x) big  [RTS]
Tell if number is arbitrary precision
returns ?+ or ?- for numbers,
and void else

math is big (an)  [RTS] Deprecated.
Tell if number is arbitrary precision
returns ?+ or ?- for numbers,
and void else

float (x) is near (y) by (d)  [RTS]
checks if two rounded (float) numbers are nearly equal,
i.e. their difference relative to the larger is (d).
If (d) is void, 5.0*$SYSTEM.epsilon is used.
Smaller values might give unexpected results,
in particular, d < $SYSTEM.epsilon will always return false.
Intentionally not a class function, too specific.

float (x) is near (y)  [RTS]
Alias for
     float (@) is near (y) by ()

system process fork  [RTS]
Spawn a process, i.e. create a new process called child process.
Returns the integer 0 within the child process,
and the process id in the parent process.

system process wait  [RTS]
Wait for state changes in a child of the calling process,
i.e. wait for any child to die,
and return the process id of that child.

system process own id  [RTS]
get my process id

system process kill (pn) with (signo)  [RTS]
Kill process with number 'pn', using signal 'signo',
given as integer. See 'man 7 signal'.

system process kill (pn)  [RTS]
Kill process with number 'pn', using singal SIGTERM.

bunch (bunch) get fields  [RTS]
Create a map with field names as keys and their values.
If the argument is not a row, map, fault item or chunk,
void is returned (not a fault item).
May be used in conjuntion with 'set fields' to transfer fields.

bunch (bunch) set fields (map)  [RTS]
Set the fields of a bunch with the values given in an map.
For each key in the map, the corresponding field is set.
If either argument is void, void is returned.
If the keys are not words, it is a fatal error.
Void is returned in any case, not the target bunch reference.
Intended in buch copy operations after newly created ones,
thus does not change fields not in the map.

call (func) with (parm)  [RTS] Deprecated.
call function with one parameter
 return void if func is void

call (func) with (parm1) and (parm2)  [RTS] Deprecated.
call function with two parameters
 return void if func is void

call (func) with (parm1) and (parm2) and (parm3)  [RTS] Deprecated.
call function with three parameters
 return void if func is void

call (func) using (parm)  [RTS] Deprecated.
call function (func) with one parameter
 return void if func is void

call (func) using (parm1) and (parm2)  [RTS] Deprecated.
call function (func) with two parameters
 return void if func is void

call (func) using (parm1) and (parm2) and (parm3)  [RTS] Deprecated.
call function (func) with three parameters
 return void if func is void

call function (func) using (parm)  [RTS] Deprecated.
call function (func) with one parameter
 return void if func is void

call function (func) using (parm1) and (parm2)  [RTS] Deprecated.
call function (func) with two parameters
 return void if func is void

call function (func) using (parm1) and (parm2) and (parm3)  [RTS] Deprecated.
call function (func) with three parameters
 return void if func is void

system exit (retcode)  [RTS]
Stop the programme immediately and exit to the caller.
No internal cleanup is done,
in particular no check for memory leaks.
Graceful exit with check is done via return of the main function.
The return code is taken mod 128 (bits 0..6) by most shells.
If the retcode is void, return code is 0.
If the retcode is not an integer, or less than zero, 127 is used.
Note that program termination by a signal often uses 128+signo,
i.e. 130 for terminal interrupt.

new fault (errno)  [RTS]
Create a fault item
Sets .errno from parameter, .checked to integer 0,
and .backtrace, .lineno and .prototype from system information.
All other fields must be set by the programmer.

new fault (errno) message (msg)  [RTS]
Create a fault item
Sets .errno and .message from parameter,
.checked to integer 0,
and .backtrace, .lineno and .prototype from system information.
All other fields must be set by the programmer.

new fault code (code) message (msg)  [RTS] Deprecated.
Alias for: new fault (errno) message (msg)

error dump (x) (depth)  [RTS]
Dump information for item to standard error depth limited

error dump (x)  [RTS]
Dump information for item to standard error

debug dump (x)  [RTS]
Dump information for item to standard error,
if debug output is enabled

error info (x)  [RTS]
information on item without full tree dump to stderr

debug info (x)  [RTS]
information on item without full tree dump
if debug output is enabled

system info enable  [RTS]
Enable runtime report

runtime statistics enable  [RTS] Deprecated.
Enable runtime statistics
Use 'system info enable'

system info disable  [RTS]
Disable runtime report

debug enable  [RTS]
Enable debug output

debug disable  [RTS]
Disable debug output

debug is enabled  [RTS]
Check if debug is enabled

system set locale (cat) to (val)  [RTS]
Set a certain locale to a value given a string.
Locales to set are:
ALL, COLLATE, CTYPE, MESSAGES, MONETARY, NUMERIC, TIME

system set locale  [RTS]
Set locale as given in the environment variables.
If not called, the locale will be 'C',
i.e. not automatically used.

system get locale  [RTS]
Obtain current locale string

system get locale numeric  [RTS]
Obtain current locale numeric formatting informaton
Returns a map with the fields:
    .dpoint     string between unit digis and fractional digits
    .groupsep   string to insert before each group of digits
Not yet:
    .grouping   tuple of integer for the number of digits per group

system get environment  [RTS]
Get the environment, i.e. the shell variables,
and return a map of variable names and (string) values.

system epoch seconds  [RTS]
Get the current time as seconds since the epoch,
i.e. since 1970-01-01 00:00:00 +0000 (UTC)
Its purpose is to provide consistent time stamps,
so leap seconds are ignored
and all years divisible by 4 are leap years.

seconds since epoch  [RTS] Deprecated.
Alias for: system epoch seconds

time (seconds) unpack local as map  [RTS]
Deliver local time and date as fields of a map res:
 res.sec     seconds 0..60 (60 for leap seconds)
 res.min     minutes 0..59
 res.hour    hours 0..23
 res.day     day of the month 1..31
 res.month   month 1..12
 res.year    year > 1970
 res.wday    day of the week 1..6 (monday = 1)
 res.yday    day in the year 1..365 (1 jan = 1)
 res.isDST   is daylight saving time
 res.offUTC  seconds east of UTC
 res.timezone timezone abbreviation (string)

time (seconds) unpack as map  [RTS]
Deliver UTC time and date as fields of a map res,
 fields see localized version

time (seconds) format (fmt)  [RTS]
Provide formatting of a time stamp localized.
Formatting is done using the 'strftime' function;
see its manual page for format codes.
The result must not execeed 200 characters (bytes).
The format must be an ASCII string, as multibyte
characters could contain the conversion byte '%'.

If the size of the buffer is exceeded, the empty string
is returned (due to strftime interface),
which may also be the case for some format codes.

system cpu seconds  [RTS]
Get the cpu-time used so far in seconds as a floating point number
It might overflow (cross zero) on e.g. 72 minutes,
and does not start at zero

seconds cpu time  [RTS] Deprecated.
Alias for: system cpu seconds

system cpu times  [RTS]
Get the cpu-times used so far in seconds as a floating point number
Returns a map with the fields (float):
    .utime  user time for current process (whithout children)
    .stime  system time as above
            i.e. kernel cpu time on behalf of the current process
    .cutime sums of .utime values
            for the current and all terminated children
    .sutime sums of .stime values as befoe

system clock (which)  [RTS]
Get the high-resolution times.
The parameter is a string selecting the clock source:
  real      wall clock time, including time adjustmets
  TAI       International Atomic Time (monotonic, no leap seconds)
  monotonic each call is equal or greater the preceeding
            not continued while suspended.
            Use only differences
  process   CPU time for process (incl. threads)
  thread    CPU time for the current thread


Result is a triple of integers:
- seconds
- nanoseconds
- resolution  (in nanoseconds)

Resolution means smallest step, not accuracy

system sleep (seconds)  [RTS]
Suspend execution for a given interval (in seconds) at least.
Argument may be integer or float;
the latter used to sleep in microseconds.
if >=1.0, truncate to integer.

sleep (seconds) seconds  [RTS] Deprecated.
Alias for: sleep (seconds) seconds

system command (cmd)  [RTS]
Run a command by the shell.
The command string is executed in a new process as
    /bin/sh -c "string"

If the return code is 0, void is returned.
If the command exited with a non-zero code, it is returned,
unless it is 127, telling that the shell could not execute
the command, returning a fault item.
If command execution failed, a fault item is returned.

Output goes to the terminal.

Using this function when the process is privileged (euid = 0)
is a fatal error.

random set seed (seed)  [RTS]
Sets the seed for 'random next integer' simple pseudo random number generator
If the argument is void, the current time in seconds is used

random next integer  [RTS]
Supply another simple pseudo random integer
 Range is 0 to $SYSTEM.randmax (both inclusive)

system fault mode (fm)  [RTS]
Set or get fault mode for operators
and return the previous mode as a string:
    "stop", "delay", "pass"
If (fm) is a string, the first character (any case)
determines the new fault mode.
Silently ignored if no match, or void, or any other item.

TAVPL_rtstav.tav

from (first) downto (last)  [RTSTAV.TAV]
Generates numbers starting at (from) down to (last)
At end, the next value, i.e. (last-1), is returned.

from (first) upto (last)  [RTSTAV.TAV]
Generates numbers starting at (from) up to (last)
At end, the next value, i.e. (last+1), is returned

from (first) upto (last) step (step)  [RTSTAV.TAV]
Generates numbers starting at (first) up to (last) incremented by (step)
The step value is added and may result in an endless loop if zero;
hence it is checked initially (not while actually used).
At end, the next value > (last) is returned
Parameters must be either accurate (integer, rational) or approximate (float) numbers

from (first) downto (last) step (step)  [RTSTAV.TAV]
Generates numbers starting at (first) down to (last) decremented by (step)
The step value is subtracted and may result in an endless loop if zero;
hence it is checked initially (not while actually used).
At end, the next value < (last) is returned
Parameters must be either accurate (integer, rational) or approximate (float) numbers

from (first) to (last) step (step)  [RTSTAV.TAV]
Generates numbers starting at (first) using (step)
Depending on the sign of (step), upto or downto (limit) is used.
Zero step terminates immediatly (nearly zero for floats).
All kinds of numbers are possible.

from (start) to (end)  [RTSTAV.TAV]
Simple number enumeration
If (start) = (end), it is delivered once.
If (start) > (end), the step is +1
else the step is -1.

give numbers (arg)  [RTSTAV.TAV]
Generalised scan to generate numbers

If (arg) is a triple of  numbers (b, e, s), they are generated
starting with b, until e (included) with step (s) are produced.
The step may be positive or negative;

If (arg) is a pair (b, e), the triple (b, e, 1) is used.

If (arg) is single integer, the triple (1, e, 1) is used.

If (arg) is a tuple and the first element also a tuple,
all tuples of arg are used recursively.

Examples:
    give numbers 5              ==  1, 2, 3, 4, 5
    give numbers 2, 4
    give numbers 2 -> 4         ==
    give numbers 7, 3, -1       ==
    give numbers 1 -> 4, 11-> 14 ==
    give numbers (1, 5, 2), (8, 9)

No check is made for e.g. step=0 or other combinations that
result in nearly endless situations.

If not in a scan context, a tuple is created by
    :> new tuple using `give numbers ()` with arg

string (@) pad left to (len) by (chr)  [RTSTAV.TAV]
Pad the string (@) at the start by the character (chr) to the length (len).
If its length already greater than (len), return unchanged.

string (@) pad right to (len) by (chr)  [RTSTAV.TAV]
Pad the string (@) at the end by the character (chr) to the length (len).
If its length already greater than (len), return unchanged.

pad left (mixed) to (len) by (chr)  [RTSTAV.TAV]
If the parameter (mixed) is a number, convert it to a string (by catenation),
then fill at the start by the character (chr) to the length (len).
If its length already greater than (len), return unchanged.

pad left (mixed) to (len)  [RTSTAV.TAV]
If the parameter (mixed) is a number, convert it to a string (by catenation),
then fill at the start by the character (chr) to the length (len).
If its length already greater than (len), return unchanged.

pad right (mixed) to (len) by (chr)  [RTSTAV.TAV]
If the parameter (mixed) is a number, convert it to a string (by catenation),
then fill at the end by the character (chr) to the length (len).
If its length already greater than (len), return unchanged.

pad right (mixed) to (len)  [RTSTAV.TAV]
If the parameter (mixed) is a number, convert it to a string (by catenation),
then fill at the end by the character (chr) to the length (len).
If its length already greater than (len), return unchanged.

pad left (len) (str)  [RTSTAV.TAV]
Alias for: pad left (str) to (len)

pad right (len) (str)  [RTSTAV.TAV]
Alias for: pad right (str) to (len)

pad (len) (str)  [RTSTAV.TAV]
Pad left (len>0) or right (len<0) string or number

tuple (@) as string  [RTSTAV.TAV]
Convert a tuple to a string that could be used as a list to re-create.
Each element is catenated to a string, joined by a comma,
except pairs. which are joined by '->'.
Thus it is converted in the default format used by string catenation,
including sub-tuples converted recursively.

tuple (@) as string parenthesized  [RTSTAV.TAV]
Convert a tuple to string, enclosed in parentesis.
See 'tuple (@) as string' otherwise.

string (@) localize  [RTSTAV.TAV]
Provide localization for a string.
Called automatically for each string literal in quotes (")

float (x) split decimal  [RTSTAV.TAV]
Convert a floating point number (x) to a pair of integers (i, e)
such that f = i * 10^e (approximately).
The maximum number of digits in (i) (when converted to decimal)
is normally 15, as determined by $SYSTEM.floatdigits.
Used is a machine independent method, that first determines (e)
and then (i) by f * 10.0^(digits - e)
(i) is rounded and trailing zeros in i are then eliminated,
i.e. the last digit is not 0.

float (@) as integer  [RTSTAV.TAV]
Convert a floating point number to an integer, unlimited.
The result has upto 15 significant decimal digits
from the argument, filled with zeros for the required magnitude:
    i, e =: float f as pair
    :> e * 10^i

tuple (@) as map  [RTSTAV.TAV]
Create a new map from a tuple of key-value pairs,
e.g. 'a' -> 1, 'b' -> 2, ...
Duplicate keys overwrite the value.

tuple (@) as row  [RTSTAV.TAV]
Create a row from a tuple

map (@) key by value (val)  [RTSTAV.TAV]
Get any map key by value.
If there are multiple keys with the same value,
it is undefined which key is found.
Consider usign "map (@) keys by value (val)"

map (@) give values  [RTSTAV.TAV]
Scan to provide the actual values of a map unsorted.
Uses 'map () give keys' to deliver keys,
provides actual value instead of key.

map (@) give pairs  [RTSTAV.TAV]
Scan to provide key-value pairs of a map (unsorted)
Uses 'map () give keys' to deliver keys,
provides actual key-value pair.

tuple (@) hash  [RTSTAV.TAV]
Hash for a tuple: same method as for string characters
but with a different factor 9973

tuple (@) negate  [RTSTAV.TAV]
Tuple number sign negation.
A tuple with each element numerically negated is returned.
The numbers may be of different kinds.

tuple (@) inverse  [RTSTAV.TAV]
Tuple number inverse.
A tuple with each element numerically inverted (reciprocal) is returned.
The numbers may be of different kinds:
Float gives float,
interger or rational gives integer or rational.

tuple (@) add (x)  [RTSTAV.TAV]
Tuple addition.
If both operands are tuples, they must have equal size,
and are added elementwise.
The second operand may be a plain number that is added
to each element of the tuple.
For consistency, the first parameter must be a tuple.

tuple (@) subtract (x)  [RTSTAV.TAV]
Tuple subtraction.
If both operands are tuples, they must have equal size,
and are subtacted elementwise.
The second operand may be a plain number that is subtracted
from each element of the tuple.
For consistency, the first parameter must be a tuple.

tuple (@) multiply (x)  [RTSTAV.TAV]
Tuple multiplication.
If both operands are tuples, they must have equal size,
and are multiplied elementwise.
The second operand may be a plain number that is multiplied
with each element of the tuple.
For consistency, the first parameter must be a tuple.
There is no division function; multiply the inverse.

tuple (@) apply (func)  [RTSTAV.TAV]
Apply a unary function to all elements of a tuple.
Not difficult to do explicitly, but may make the code clearer

fault (@) print  [RTSTAV.TAV]
Print fault item on standard error (compact information)
silent if not a fault
does not mark it checked; must be done by caller

fault (@) print backtrace  [RTSTAV.TAV]
Print fault item on standard error (compact information)
with function backtrace
silent if not a fault
does not mark it checked; must be done by caller

fault (@) print stop  [RTSTAV.TAV]
If the argument is a fault item, print with backtrace,
then exit prematurely with return code '256-@.errno'

is (@) fault stop  [RTSTAV.TAV]
If the argument is a fault item, print a message
then exit prematurely with return code '256-@.errno'

is (@) fault backtrace  [RTSTAV.TAV]
If the argument is a fault item, print with backtrace,
then exit prematurely with return code '256-@.errno'

system clock seconds  [RTSTAV.TAV]
The real (wall) clock time in seconds as float
monotonic from an undefinded start point,
for use as differences between calls.

See "system clock microseconds" for integer result.
Uses "system clock 'monotonic'" as source.

system clock microseconds  [RTSTAV.TAV]
No documentation

system cpu seconds  [RTSTAV.TAV]
The accumulated cpu time in seconds as float,
for all threads in the current process.

Uses  as source.

system cpu microseconds  [RTSTAV.TAV]
The accumulated cpu time in microseconds as integer,
for all threads in the current process.

While the source may resolve nanoseconds, the accuracy
is not better than mircoseconds.

Uses  as source.

new row using (func) with (arg)  [RTSTAV.TAV]
Create a row with a scan function with one argument:
    r =: new row using `give numbers ()` with 1,5
(func) is a function reference to a scan function with one argument
(arg) is the argument to be used for the scan

new row using (func) with (arg1) (arg2)  [RTSTAV.TAV]
Create a row with a scan function with two arguments:
    r =: new row using `from () upto` with 1 5
(func) is a function reference to a scan function with one argument
(arg1) is the 1st argument to be used for the scan
(arg2) is the 2nd argument to be used for the scan

new tuple using (func) with (arg)  [RTSTAV.TAV]
Create a tuple with a scan functin with one argument, e.g.:
    r =: new row using `give numbers ()` with 1,5
(func) is a function reference to a scan function with one argument
(arg) is the argument to be used for the scan

new tuple using (func) with (arg1) (arg2)  [RTSTAV.TAV]
Create a tuple with a scan function with two arguments, e.g.:
    r =: new tuple using `from () upto` with 1 5
(func) is a function reference to a scan function with two arguments
(arg1) is the 1st argument to be used for the scan
(arg2) is the 2nd argument to be used for the scan

TAVPL_strings.c

string (@) check ascii  [STRINGS]
Check if a string is ASCII.
Re-scan the string and set in particular the .isascii attribute
As strings are immutable, a copy is returned if .isascii is changed,
orignal returned otherwise (including void)

string (@) from (start) length (len) step (step)  [STRINGS]
Copy part of a string.
(start) denotes the first character to copy,
(len) the number of characters to copy, i.e. the maximum result length,
(step) a step value.

The start position 1 is the first character;
if beyond the last character, the empty string is returned.
if negative, it is counted from the end, -1 is the last character.
If before the start of the string (<1), it is set to 1.
Zero as start postion returns void.

The length indicates how many characters to copy at most.
Zero or negative return an empty string.

The step may be any integer and is added to the current position
once a character is copied.
Zero results in the start character duplicated as many times
as (len) gives.
Negative values go back in the string.

RAW or ASCII strings are processed bytewise and result in the same
(no check if RAW is ASCII then, do it yourself)

Character means UTF code point.

string (@) from (first) length (len)  [STRINGS]
Copy the part of the string 'src' from 'first' upto 'length' characters.
'first' may be less than zero to denote counting from the end
(-1 is the last character, i.e. 'src.count').
If 'first' is zero, a fatal runtime error is caused.
If 'len' is zero or negative, the empty string is returned.
Attempts to exceed the string limits are silently truncated.
If 'src' is an empty string, the empty string is returned;
If 'src' is void, void is returned.
If the whole string is selected, it is not copied,
but the reference returned instead.

string (str) clip from (first) length (len)  [STRINGS] Deprecated.
Alias for 'string (@) from (first) length (len)

clip (src) from (first) length (len)  [STRINGS] Deprecated.
Alias for 'string (@) clip from (first) length (len)

string (@) from (first) upto (last)  [STRINGS]
Copy the part of the string 'src' from 'first' to 'last'.
'first' and 'last' may be less than zero to denote counting from the end
(-1 is the last character, i.e. at 'src.count').
If 'first' is zero, the empty string is returned.
If 'last' is zero, the whole string is returned.
Attempts to exceed the string limits are silently truncated.
If 'src' is an empty string, the empty string is returned;
If 'src' is void, void is returned.

string (str) clip from (first) upto (last)  [STRINGS] Deprecated.
Alias for 'string (@) from (first) upto (last)

clip (src) from (first) upto (last)  [STRINGS] Deprecated.
Alias for 'string (@) from (first) upto (last)

string (@) from (first)  [STRINGS]
Copy the part of the string 'src' that starts at 'first' upto the end.
Equivalent to 'string (@) clip from (first) upto (src.count)'

string (str) clip from (first)  [STRINGS] Deprecated.
Alias for 'string (@) from (first)'

clip (src) from (first)  [STRINGS] Deprecated.
Alias for 'string (@) from (first)'

string (@) upto (last)  [STRINGS]
Copy the part of the string 'src' upto the 'last' character.
Equivalent to 'string (@) clip from (1) upto (last)'

string (str) clip upto (last)  [STRINGS] Deprecated.
Alias for 'string (@) upto (last)

clip (src) upto (last)  [STRINGS] Deprecated.
Alias for 'string (@) clip from (first) upto (last)

string (@) locate (needle)  [STRINGS]
In string 'str', locate the string 'needle'.
On success, return the start position.
On failure, return integer zero.
If 'needle' is the empty string, the result is 1.
If 'needle' is void, the result is 0
If 'str' is void, the result is void.

string (@) locate (needle) from (start)  [STRINGS]
In string 'str', locate the string 'needle', starting at 'start'.
Start may be negative and then counts from the end (-1 is the last
character), but may neither be 0 nor void.
On success, return the start position, which may be negative.
On failure, return integer zero.
If 'needle' is the empty string, the result is 1.
If 'needle' is void, the result is 0.
If 'str' is void, the result is void.

string (@) times (ni)  [STRINGS]
Concatenate string 'str' for 'ni' times, without delimiters.
If the source string is empty, or the count (ni) is zero or void,
the target string is the empty string.
The source must be a string, and cannot be void.

string (@) as integer clib (base)  [STRINGS]
Convert 'str' to an integer number determined by 'base'
using the C library function 'strtol'
or the GNU multi precison library equivalent 'mpz_.set_str'.

String 'str' may begin with an arbitrary amount of white space,
followed  by  a  single optional '+' or '-' sign.

If base is void or 0, the base is determined by a prefix (after a sign):
If it is '0x' or '0X', the base is 16; if it is 0, the base is 8.
Otherwise, the default base is 10.
If the base is 16, a prefix of '0x' or '0X' is optional.

In bases above 10, the letter 'A' in  either  upper- or lowercase
represents 10, 'B' represents 11, and so forth, with 'Z' representing 35.

Using bases above 36 is not recommended, although it may work.
See 'string (@) as integer base (basespec)' as alternative.

Deviating from 'strtol', the string may not contain arbitrary
characters after a valid number, only white space,
otherwise a fault item is returned.

An empty string returns integer 0.
Void returns void for easier map handling.

See also 'string (@) as integer base (basespec)'.

as integer (str) clib (base)  [STRINGS] Deprecated.
Alias for: string (@) as integer clib (base)

as clib integer (str)  [STRINGS] Deprecated.
Alias for: string (@) as integer clib (0)
  i.e. using C conventions

integer from (str) base (base)  [STRINGS] Deprecated.
Alias for: string (@) as integer clib (0)
  i.e. using C conventions

string (@) as float  [STRINGS]
Convert the string 'str' to a rounded (floating point) number.
using 'strtod', which besides decimal numbers like '3.5E-9'
also allows hexadecimal number like '0x123P3' for 123*2^3.
Only blanks may enclose the number.
Returns fault item on error.
Return void from void as with integers.

as float (str)  [STRINGS]
Alias for: string (@) as float

system cformat (format) (num)  [STRINGS] Deprecated.
Format a single number using C library '(s)printf' formats,
see its manual page for format codes.

First parameter (format) is the format string,
second an integer or a float.
Integers are 64-bit, i.e. long long int, thus use "%lld".
Floats are double.

The format string is not checked and must be ASCII only.
It must produce less than 333 characters, or a fault item is returned.
(The format '%.16f' for the maximum number 1.0E308 produces
15 leading significant digits, followed by many insignifant ones.)

Neither rationals nor arbitrary precision (big) numbers can be used.

A void argument returns void.

To be used provisionally in tuflib for 'format () ()';
improper use may crash programmes until more checks are programmed

cformat (format) number (num)  [STRINGS] Deprecated.
Alias for:  system cformat (format) number (num)

cformat (format) (num)  [STRINGS] Deprecated.
Alias for:  system cformat (format) (num)

float (@) as string digits (d)  [STRINGS]
Convert a float to a string in exponential format
 with {d} digits precision.
 There is one (non-zero) digit, followed by the decimal point,
 followed by (d) significant digits.
 (d) is between 1 and 14 (adjusted if out of range)

float (@) as string strict (d)  [STRINGS]
Convert a float to a string in strict fixed point format
 with (d) digits after the decimal point.
 {d} is between 1 and 14 (adjusted if out of range, void is 14).
 If (@) < 1.0, one insignificant zero is followed by the decimal point,
 a block of insignificant zeros,
 followed by the significant digit(s) (also trailing zeros).
 If (@) < 0.001 or > 10.0^(d-1),
 insignificant or excessively many digits would be produced;
 instead, a fault item (exponential form in .info) is returned.

float (@) as string fixed (d)  [STRINGS]
Convert a float to a string in fixed point format
 with (d) digits after the decimal point.
 {d} is between 1 and 14 (adjusted if out of range).
 If (@) < 1.0, one insignificant zero is followed by the decimal point
 and insignificant zeros,
 followed by the significant digit(s) (which may be a zero).
 If (@) < 0.001 or > 10.0^(d-1),
 insignificant or excessively many digits would be produced;
 instead, exponential form (with full precision) is returned.

float (@) as string (d)  [STRINGS]
Convert a float to general format with (d) digits.
 {d} is at least 2 and at most 15 (adjusted if out of range)
 If (@) < 0.001 or > 10.0^(d-1), exponential format is used.
 If (@) < 1.0, an insignificant zero is followed by a decimal point
 and upto 2 insignificant zeroes, followed by the significant digits,
 including zeroes.
 If (d) is void, the standard conversion (float () as string) is
 used that does not have trailing zeroes after the decimal point.

float (@) as string  [STRINGS]
Returns a (decimal) string converted from a float.

Floating point numbers are shown with upto 6 decimal places
in fixed point (decimal) form with always a decimal point
and neither trailing zeros nor insignificant digits,
except zeros around the decimal point if < 1.0.
If < 0.001 or > 99999.9, exponential format is used.

This is the same format used for catenating strings with numbers.

integer (@) as string  [STRINGS]
Returns a (decimal) string converted from an integer.

This is the same format used for combining strings with numbers.

rational (@) as string  [STRINGS]
Returns a (decimal) string converted from a rational.

Uses two decimal integers for denominator and numerator,
connectd by a slash.

This is the same format used for combining strings with numbers.

as string (num)  [STRINGS]
Returns a (decimal) string converted from any kind of number.
For integers, just the digits (and a leading minus) are given;
for rationals, two numbers separated by a slash (e.g. -3/4).
Floating point numbers are shown with upto 6 decimal places
or in exponential form, similar to %G by printf,
but with always a decimal point and at least one digit behind.

This is the same format used for combining strings with numbers.

If the argument is already a string, it is returned unchanged.

Void returns void, and any other kind a fault item;
this may make map handling easier.

item (num) as string  [STRINGS] Deprecated.
Alias for: number (num) as string

number (num) as string  [STRINGS] Deprecated.
Alias for: number (num) as string

boolean (b) as string  [STRINGS]
returns a boolean as string '?+' or '?-'
Void returns void for easier map handling.

integer (i) code point as string  [STRINGS]
convert a character code (code point in Unicode terminology)
to a one-character length string.
The code point must be a non-negative number in the range of Unicode code points.

string (@) code point at (pos)  [STRINGS]
Give the integer character code (code point in Unicode terminology)
of the character at 'pos' in string 'str', 1 is the first character.
If 'pos' is less zero, it is counted from the end, -1 is the last character.
If 'pos' is zero or beyond the size of the string, null is returned,
as integer 0 is a valid code point.

string (@) case starts upper  [STRINGS]
Tests the first character in string (@) for upper case.
Returns ?+ if it is upper case (not the negation of lower case).
return ?- if not or empty string.
Void is returned as void.
Is not the negation of lower case test.
Call 'system set locale' to check for non-ASCII characters

string (@) starts upper case  [STRINGS] Deprecated.
Alias for 'string (@) case starts upper'

string (@) case starts lower  [STRINGS]
Tests the first character in string (@) for lower case.
Returns ?+ if it is lower case (not the negation of upper case).
return ?- if not or empty string.
Void is returned as void.
Call 'system set locale' to check for non-ASCII characters

string (@) starts lower case  [STRINGS] Deprecated.
Alias for 'string (@) case starts lower'

string (@) case to upper  [STRINGS]
Convert string characters to upper case
Void is returned void, empty string unchanged
Call 'set locale' to convert non-ASCII characters

string (@) in upper case  [STRINGS] Deprecated.
Alias for string (@) case to upper

string (@) case to lower  [STRINGS]
Convert string characters to lower case
Void is returned void, empty string unchanged
Call 'set locale' to convert non-ASCII characters

string (@) in lower case  [STRINGS] Deprecated.
Alias for string (@) case to lower

string (@) hash  [STRINGS]
Simple Hash function for strings (with collisions)
returns an unsigned integer number calculated iteratively by
    sum =: (sum * 127 + byte[i])
where  byte[i] is the i-th byte (not code point)
and the sum starts with the number of bytes.
The sums are taken modulo 31 or 63 bits.
The function is ten times quicker than MD5 or SHA1,
and has no collisions with 25000 words from unixdict.txt.
Although the runtime is proportional to the number of bytes,
it is still quicker than creating and processing these strings
so any variant that uses only head and tail need not be considered.

string (@) decode percent encoding  [STRINGS]
replace all occurences of %xx with single bytes, as is used for
 HTML query strings including UTF-8 encoded characters.
 Replacement of '+' by space is not done.
 The result is marked as ASCII or RAW, unless it is valid UTF-8.
 Input markings of ACSCII and RAW are ignored, and UTF-8 strings
 are treated bytewise, not characterwise.
 E.g. "a%DCöx" is very dubious, but allowed by the standard,
 and result in a string with the .raw attribute set.
 Note that %25 results in a '#' character in the output.
 If '#' is not followed by two hex digits, it is copied to the output
 and scanning continues with the next character.
 Normally, input should only be strings with the .ascii atribute set.
 Newline characters are silently ignored and not copied.

print (mixed) nonl  [STRINGS]
print an item in default format to standard output,
without trailing line feed
See print ()

print partial (mixed)  [STRINGS] Deprecated.
print an item in default format to standard output,
without trailing line feed
Deprecated, use print (mixed) nonl

print (mixed)  [STRINGS]
Print item in default format to standard output,
followed  by a line feed.
If the argument is a tuple, the elements are printed individually,
separted by a single blank space.
Strings are printed literally, without quotes.
Integers are printed as (full) decimal numbers.
Rationals are printed as two decimal numbers with a slash.
Real numbers are printed in a default format (as if catenated to a string).

Rows and maps are printed as [n] and {n}, where n is the number of elements.
A fault item is represented by '' (without quotes)
This is specific to print and not supported by string catenation.

Because a tuple print is recursively, it is effectively flattened
(all values shown as one long list separted by blanks).
If output shall be different, use 'tuple (@) as string'
or catenate it to the empty string:
    x =: 1, 2, 3, 'a', 3.5
    print '' _ x

For a different separator, use 'join (tuple) by (sep)'.

If output is a terminal, stdout is flushed

error print (mixed) nonl  [STRINGS]
print an item in default format to standard error,
without trailing line feed
Stream stderr is flushed even if not a terminal

error print (mixed)  [STRINGS]
print item in default format to standard error,
followed  by a line feed.
Stream stderr is flushed even if not a terminal

debug print (mixed) nonl  [STRINGS]
Print argument without linefeed to standard error
if the global DEBUG flag is set.

debug print (mixed)  [STRINGS]
Print argument and linefeed to standard error
if the global DEBUG flag is set.

error print (mixed) lno  [STRINGS]
Print source linenumber and argument to standard error.
Same as: error print '@&lineno;:',  _ mixed'

debug print (mixed) lno  [STRINGS]
Print source linenumber and argument to standard error
if the global DEBUG flag is set.
Same as: debug print '@&lineno;:',  _ mixed'

error print (mixed) here  [STRINGS]
Print source position and argument to standard error

debug print (mixed) here  [STRINGS]
Print source position and argument to standard error
if the global DEBUG flag is set.

error dump calls (depth)  [STRINGS]
print the current function call stack to stderr
 (depth) may be void or zero for no limitation,
 or a non-zero integer to limit the number of entries.

debug dump calls (depth)  [STRINGS]
print the current function call stack to stderr
 (depth) may be void or zero for no limitation,
 or a non-zero integer to limit the number of entries.

TAVPL_inout.c

system standard input  [INOUT]
file handle for the standard input stream

system standard output  [INOUT]
file handle for the standard output stream

system standard error  [INOUT]
file handle for the standard error stream

new file stream filename (fn) mode (str)  [INOUT]
Open a file for linewise access
 Mode indicators are:
 'r'     reading only, file must exist
 'r+'    reading and writing, file must exist
 'w'     writing only, truncated or newly created
 'w+'    reading and writing; truncated or newly created
 'a'     appending only; empty file created if not existiing
 'a+'    reading and writing, position to end initially, created if not existing

 On error, a fault item is returned with
     .errno  the system error integer number
     .msg    the corresponding string
     .info   not set

new file stream reads (fn)  [INOUT]
Open a file for linewise reading only.
 The file must already exist.
 Reading starts at the first byte.
 Same as mode 'r'

new file stream modifies (fn)  [INOUT]
Open a file for linewise reading and writing.
 The file must already exist.
 There is one common file position, that is
 advanced by both, reading and writing.
 Same as mode 'r+'

new file stream rewrites (fn)  [INOUT]
Open a file for linewise writing only.
 Truncated if it exists, created otherwise.
 Same as mode 'w'

new file stream replaces (fn)  [INOUT]
Open a file for linewise reading and writing.
 Truncated if it exists, created otherwise.
 Starts at the beginning of the file.
 Same as mode 'w+'

new file stream appends (fn)  [INOUT]
Open a file for append writing only
 Created if the file does not exist.
 Any write appends data to the current end of the file.
 Same as mode 'a'

new file stream updates (fn)  [INOUT]
Open a file for linewise reading and appending
 Reading starts at the first byte and advances the position,
 but any write appends data to the end of the file,
 leaving the position after the last byte written.
 If the file does not exist, it is created.
 Same as mode 'a+'

file stream (@) close  [INOUT]
Drops, i.e. closes, a file stream.
Although streams are closed automatically when the item is discarded,
errors can only be captured with a explicit close,
otherwise they are a fatal runtime error.

Returns the null reference on success.
If an error occured, a fault item is returned.

file stream (@) flush  [INOUT]
Flushes a file stream, i.e. drains internal buffers
so that the data is available for other processes
Avoid flushing of read-only streams
Returns null or a fault item.

file stream (@) tell  [INOUT]
Returns an integer giving the current file position,
which is a byte number.
Note that unless the stream is read as raw strings,
this number may be larger than the number of characters
if UTF-8 encoded bytes are present.
a fault item is returned if the stream is not seekable,
e.g. a pipe or standard input from a terminal.

file stream (@) seek (loc)  [INOUT]
sets the current file position of 'stream' to byte number 'loc',
counted from the beginning.
Note that for UNIX file semantics, positioning behind the end
is possible and extends the file.
a fault item is returned if the stream is not seekable,
e.g. a pipe or standard input from a terminal.

file stream (@) get  [INOUT]
Returns the next line from 'stream' as a string.
Line delimiters are linefeed characters.
The line is always scanned and marked as RAW, ASCII or UTF-8.
If the file is at its end, null is returned.

The delimiting line feed character is **not** part of the returned string,
and any trailing carriage return character is also removed.
Thus, using this interface, there is no difference
whether the last character of a (text) file is a linefeed or not.

Note that UNIX streams use zero-terminated strings,
thus no zero byte will ever be part of the string.

If such a stream read is too restrictive,
use the basic unbuffered I/O (read and write).

file stream (@) put (string)  [INOUT]
Writes the contents of the string 'line' to 'stream',
followed by a line feed character.

Thus, using this interface, there is no way to write a text file
that has not a line feed as last character.
If the string contains line feed characters,
these are not removed, even if this may be (ab-) used to write
more than one line in a single call.
Also, trailing carriage returns are not removed,
but do not show if the file read in later as a stream.
Consequently, no partial lines can be written.

Note that UNIX streams use zero-terminate strings,
thus if the string contains zero bytes, it will be truncated there.

Return is always a null reference,
unless an error occured, and a fault item is returned.

If such a stream write is too restrictive,
use the basic unbuffered I/O.

file stream (@) append (line) atomically  [INOUT]
Appends the string 'line' atomcially to 'stream'.
The stream must be opended in append mode.

The intended use is to use the buffered stream for reading only,
and append only with this function, even if buffers are flushed
before the write.

The stream is positioned then to current end of the file,
i.e. somewhere behind the data written.

Returns null if the write succeeds, and a fault item otherwise.

is (x) file stream  [INOUT]
check if a file stream

new command stream reads (command)  [INOUT]
Created a command pipe (command)
and a stream to read the command output.
If the environment variable 'TAVPL_NO_SHELL' is set,
this is a fatal error.
Note that /bin/sh is used, which is often /bin/dash

new command stream write (command)  [INOUT]
Created a command pipe (command)
and a stream to write the command input,
which normally will redirect its output to some file.
If the environment variable 'TAVPL_NO_SHELL' is set,
this is a fatal error.
Note that /bin/sh is used, which is often /bin/dash

command stream (@) close  [INOUT]
Drops, i.e. closes, the stream.
Although streams are closed automatically when the item is discarded,
errors can only be captured with a explicit close.

If no error occured and the return code of the command was zero,
void is returned.

If the return code of the called command is between 1 and 255,
it is given back as an integer. The value 255 is dubious.

If the pipe closed normally, but the shell used returns an error,
a fault item is returned;

If the pipe closed abnormally, a different fault item is returned.
Note: Signal 13 (SIGPIPE) occurs if data is left in the pipeq

If the pipe close signals a system error coder (-1, errno),
a corresponding fault item is returned.

In all these cases, the original return code is the .errno

command stream (@) get  [INOUT]
Return the next line from a command stream

command stream (@) put (string)  [INOUT]
Writes the contents of a string to the given command (pipe) stream,
followed by a line feed character.

Return is always a null reference,
unless an error occured, and a fault item is returned.

is (x) command stream  [INOUT]
check if a command stream

file (filename) attributes  [INOUT]
Returns the attributs of a filename or open file stream
as a map with zero elements with user fields:
The field 'ftype' returns a string, e.g.:
    file, dir, cdev, bdev, fifo, socket
Integer valued attribs are:
    inode, mode, links, uid, gid, size, atime, mtime, ctime, space, devid
Boolean fields:
    symlink, directory

If the file does not exist, a fault item is returned.

The 'space' field gives the number of bytes allocated,
if this is less than 'size', the file is sparse.

The file item may be a string as a file name,
or an open stream, or an open chunk handle.

Note that symlinks are followed, so the information is that of the file;
however, this fact is signalled by the .symlink field to be true.
Information about the symlink itself cannot be obtained by this function.
The symlink field is also set if error code 2 is returned,
meaning that the symlink refers to file that no longer exists;
in this case, the error message is changed from 'No such file or directory'
to 'Symbolic link invalid'.

If the handle for an open file is used, the filename cannot be obtained,
as the number of filenames in directories can be from zero to many
any time after the file has been opened.
So it is not supplied for requests with a filename string.

Note that the access time '.atime' may be stale, if the filesystem is
mounted with the 'relatime' option, that updates the atime only
once within 24 hours, or if it is smaller than the others,
avoiding disk writes if files are only read.

file (filename) get attributes  [INOUT] Deprecated.
Alias for: file (filename) attributes

attributes of file (filename)  [INOUT] Deprecated.
Alias for: file (filename) attributes

file (filename) extended attribute (attrname)  [INOUT]
get value of extended file attribute (user space)
 returns null if not set, a string, or a fault item
 currently, the result is truncated to 1023 bytes, if longer

file (filename) extended attribute (attrname) set (value)  [INOUT]
set value of extended file attribute (user space)
 returns null, or a fault item
 if the value is null, the attribute is removed
 removing a non-existent attribute is not an error

new directory stream reads (dirnam)  [INOUT]
Creates a stream to read directory entries line by line.

directory stream (@) close  [INOUT]
Drop (close) a running directory stream

directory stream (@) get  [INOUT]
Returns the next filename from a directory stream,
(in directory order).

file (filename) hard link to (newfilename)  [INOUT]
Create a file (hard) link
returns null reference if ok, fault item otherwise

file (filename) symbolic link to (newfilename)  [INOUT]
Create a file symbolic link
returns null reference if ok, fault item otherwise

directory (dirpath) create  [INOUT]
Creates a directory using a path.
returns null reference if ok, fault item otherwise

file (filename) unlink  [INOUT]
Unlinks a filename, i.e. deletes it from its directory,
which deletes the file if it has no more references
returns null reference if ok, fault item otherwise

file (filename) real pathname  [INOUT]
Determine canoncial absoulute pathename ('realname')

system current directory  [INOUT]
Get current (working) directory

file stream (stream) is tty  [INOUT]
check if a stream is connected to a Terminal
Argument is e.g. 'system standard output'
Returns ?+ if it is, ?- if not, fault item else

is input a tty  [INOUT] Deprecated.
Deprecated to check if a standard input is a terminal;
 use 'file stream system standard input is tty' instead

is output a tty  [INOUT] Deprecated.
Deprecated to check if a standard output is a terminal
use 'file stream system standard output is tty'

string (@) matches filename (pattern)  [INOUT]
Check if string matches shell wildcard pattern
Backslashes are matched verbatim (not used as escape character)
Leading periods are not matched by * or ?
returns boolean true or false

new file chunk create (fn)  [INOUT]
open a file for unbuffered binary chunk reading and writing.
 If the file does not yet exist, it is created, and permissions
 are then set all minus umask, valid for future opens only.
 If the file does exist, but without write permission,
 a fault item is returned.

new file chunk read (fn)  [INOUT]
open a file for binary chunk reading.
 No write permission is required on the file.
 If the file does not exist, a fault item will be returned.

new file chunk modify (fn)  [INOUT]
open a file for binary chunk reading and writing.
 Write permission is required.
 If the file does not exist, or has no write permission,
 a fault item will be returned.

new file chunk append (fn)  [INOUT]
open a file for binary chunk, reading and appending.
 Each write is preceeded by setting the file position
 to the end of the file, and then the buffer is written,
 both atomically, if it's a local file system.
 To re-read the written data, the position has to be
 set back to where it was before the write.
 Setting the position immediately before a write
 has no effect.
 If the file does not exist, a fault item will be returned.

file chunk (fd) close  [INOUT]
Drops, i.e. closes, a binary file IO
Although files are closed automatically when the item is discarded,
errors can only be captured with a explicit close,
otherwise they are a fatal runtime error.

Returns the null reference on success.
If an error occured, a fault item is returned.

file chunk (fd) read (ck) at (pos) size (size)  [INOUT]
Read a binary chunk from a file
returns the number of bytes read and changed in the chunk

file chunk (fd) write (ck) at (pos) size (size)  [INOUT]
write a binary chunk to a file
If  the  file  was opened for append, the  file offset is first set
to the end of the file before writing, both atomically.

file chunk (fd) tell position  [INOUT]
Obtain current position of a chunked file.
Returns an integer which is the zero based byte offset in the file

file chunk (fd) position (loc) start  [INOUT]
Position a chunked file relative to the start
'dist' must not be negative. Void is treated as 0.
Note: If the resultant position is beyond the current end,
no error is returned, but the space logically allocated to zero bytes.
Returns the new position relative to the start.

file chunk (fd) position (loc) current  [INOUT]
Position a chunked file relative to the current position.
'dist' may be negative. Void is treated as 0.
Note: If the resultant position is beyond the current end,
no error is returned, but the space logically allocated to zero bytes.
Returns the new position relative to the start.

file chunk (fd) position (loc) end  [INOUT]
Position a chunked file relative to the current end.
'dist' is often negative. Void is treated as 0.
Note: If the resultant position is beyond the current end (i.e. 'dist' is positive),
no error is returned, but the space logically allocated to zero bytes.
Returns the new position relative to the start.

new basic pipe  [INOUT]
Create a unidirectional pipe for interprocess I/O
 A single pipe descriptor (system item) is returned,
 that can be read or written to.

 Normally, after the creation the process is forked
 in one reading and one writing,
 the reading one closing the pipe for writing,
 the writing one closing the pipe for reading.
 Otherwise the process may block.

 Note that the UNIX system creates two file descriptors,
 that are both handled in the system item (pipe descriptor)

 Preliminary version with standard buffer length 4096
 and no logical buffering.

basic pipe (@) close reading  [INOUT]
Close the reading end of a basic pipe

basic pipe (@) close writing  [INOUT]
Close the writing end of a basic pipe

basic pipe (@) get  [INOUT]
Receive bytes at the reading end of a basic pipe as string.
A byte string of no more than 4096 bytes is read
and delivered as a string without ISO conversion,
but with UTF-8 and raw check.
The read blocks until data is available from the write end.
Returns void if the write counterpart is closed (end-of-file).

basic pipe (@) put (str)  [INOUT]
Sends a string to the reading end of a basic pipe.

If the string could not be fully delivered in one
action, a fault item is returned, and the number of bytes
(not characters) given as string in the .info field;
note that in this case, the UTF-8 encoding for the last
character may be invalid on the receiving side.

Returns void on success.

terminal prompt (prompt)  [INOUT]
Ask the user on the controlling terminal with the string (prompt)
and return the characters typed in as reply as a string.
If the last character is a newline, it is not used.
If it fails for any reason, e.g. no controlling terminal,
void is returned.
The maximum reply string is 255 bytes.
Can be used in a signal callback.

TAVPL_math.c

math sin (arg)  [MATH]
Calculate the sinus of an approximate (floating point) number

math arc sin (arg)  [MATH]
Calculate the inverse sinus of an approximate (floating point) number

math cos (arg)  [MATH]
Calculate the cosinus of an approximate (floating point) number

math arc cos (arg)  [MATH]
Calculate the inverse cosinus of an approximate (floating point) number

math tan (arg)  [MATH]
Calculate the tanges of an approximate (floating point) number

math arc tan (arg)  [MATH]
Calculate the inverse tangens of an approximate (floating point) number

math arc tan (y) by (x)  [MATH]
Calculate the arc tangent function of two floats, i.e.
 i.e. the principal value of the arc tangent of y/x,
 using the signs of the two arguments to determine the quadrant of the result.
 see man 3 atan2

math sqrt (arg)  [MATH]
Calculate the square root of an approximate (floating point) number

math exp (arg)  [MATH]
Calculate an approximate (floating point) number to the power of e

math base (base) exp (exponent)  [MATH]
Calculate an approximate (floating point) base
 to the power of any (floating point) exponent
 same as base^exponent, restricted to floating point numbers

math log (arg)  [MATH]
Calculate the natural logarithm (to the base e)

math lg (arg)  [MATH]
Calculate the logarithm to the base 10

math base (base) log (arg)  [MATH]
Calculate the logarithm to any base,
 which is
     (math log arg) / (math log base)

math int (arg) count digits (base)  [MATH]
Determine the size in (base) digits required to represent (arg),
either exact or +1, i.e. the number of digits required (without sign).
E.g. for base 2, ld(2) = 1, ld(3)=2, ld(1023)=10, ld(1024)=11
As a convenience, ld(0) = 0

If (base) is void, 10 is assumed.
if (arg) is void, 0 is returned independent of base.

Basically the same as 'count integer arg as string base base'

math int sqrt (n)  [MATH]
Integer square root (arbitrary precision)
 Largest integer when squared does not exceed the argument
 See 'math int () is square' how to test for a perfect square

float (x) split binary  [MATH]
Split a float into a normalized mantissa as float
and base 2 exponent as (signed) integer

Let
    m, e =: float (x) split binary
then
    ! is m float & is e integer
    ! x %= m * 2^e               \ as near as possible
    ! 0.5 <= m & m < 1.0

There are no conversion errors;
just the binary machine representation is extracted.

TAVPL_chunk.c

new chunk size (size)  [CHUNK]
Create new byte chunk of given size (in bytes)
If there is no space, a fault item is returned

chunk (ck) zero at (offset) size (size)  [CHUNK]
Zero a chunk slice
The size must be positive, and offset and size are adjusted if out of range.

Returns the offset of the next byte behind the filled area.

.lock, .shut are honored, and .revs is incremented.

chunk (ck) zero at (offset)  [CHUNK]
Zero a chunk slice
shortcut for 'zero chunk (chnk) at (offset) size chnk.bytes

chunk (dk) zero  [CHUNK]
Zero a chunk slice
shortcut for 'zero chunk (chnk) at 0 size chnk.bytes

chunk (ck) slice at (offset) size (size)  [CHUNK]
Create a copy of a byte chunk slice:
A new chunk of the size given is created, and filled from the slice.

The offset may be negative and is then counted from the end.
The size given must be positive and determines the size of the new chunk.
If the offset exceeds the filled area, nothing is copied,
just the new chunk created uninitialized.

If there are less bytes at the offset than the size, only these
are copied, and the new chunk partially filled.

The byte order attribute is propagated.

If there is no space for the new bunch, a fault item is returned.

chunk (ck) get integer at (offset) size (size)  [CHUNK]
Extract integer from byte chunk.

The source bytes are given by an offset (zero based) and a size;
this must be fully within the chunk to avoid data corruption.

The result is always signed;
to obtain the unsigned equivalent, add 2^8=256, 256^2=65536, 256^3=16´777´216 etc.
if negative.

If more than one byte is fetched, a byte order must be set for the chunk.

chunk (ck) get string at (offset) size (size)  [CHUNK]
Extract string from a chunk slice.

The position may be negative, and is then counted from the end.
The size must not be negative, and is adjusted so that
the slice lies in the filled space.
If may become zero; then an empty string is returned.

The resulting string is checked for UTF-8,
but currently no autoconversion is implemented.
If the source is UTF-8 and a wrong size used, the resulting string
may be truncated inside an encoding and thus flagged '.raw'.

chunk (bcr) get string at (offset) size (size) until zero  [CHUNK]
Extract string from chunk and stop if a zero byte is found.

The position may be negative, and is then counted from the end.
The size must not be negative, and is adjusted so that
the slice lies in the filled space.
If may become zero; then an empty string is returned.

The resulting string is checked for UTF-8,
but currently no autoconversion is implemented.
If the source is UTF-8 and a wrong size used, the resulting string
may be truncated inside an encoding and thus flagged '.raw'.

chunk (bcr) get string at (offset) size (size) until linefeed  [CHUNK]
Extract string from chunk and stop if a linefeed is found.

The position may be negative, and is then counted from the end.
The size must not be negative, and is adjusted so that
the slice lies in the filled space.
If may become zero; then an empty string is returned.
If no linefeed is found, null is returned,
even if there are characters left.

The resulting string is checked for UTF-8,
but currently no autoconversion is implemented.
If the source is UTF-8 and a wrong size used, the resulting string
may be truncated inside an encoding and thus flagged '.raw'.

chunk (bcr) get string at (offset) size (size) until (stop)  [CHUNK]
Extract string from chunk and stop if a given character is found.

The position may be negative, and is then counted from the end.
The size must not be negative, and is adjusted so that
the slice lies in the filled space.
If may become zero; then an empty string is returned.

The resulting string is checked for UTF-8,
but currently no autoconversion is implemented.
If the source is UTF-8 and a wrong size used, the resulting string
may be truncated inside an encoding and thus flagged '.raw'.

chunk (tgt) put string (str) at (offset) size (len)  [CHUNK]
Replace a chunk slice by a string.

The position may be negative and is counted from the end.
The size must be at least the byte length of the string,
and all bytes must fit into the chunk.
If it is shorter, the remaining space is filled with zero bytes.
If the offset is beyond the filled space, zero bytes are
prepended.

Returns the offset of the next byte behind the area written to.

Attributes .lock, .shut are checked and .revs, .filled are set.

chunk (tgt) put integer (src) at (offset) size (size)  [CHUNK]
Replace a chunk slice with a binary integer.

The position may be negative and is counted from the end.
The size must be positive, and all bytes must fit into the chunk.
If the offset is beyond the filled space, zero bytes are prepended.

Returns the offset of the next byte behind the filled area.

Attributes .lock, .shut are checked and .revs, .filled are set.

Currently, only 1 to 8 bytes are supported.

chunk (tgt) at (toffset) size (tsize) put chunk (src) at (soffset) size (ssize)  [CHUNK]
Replace a chunk slice by a chunk slice

The positions may be negative and are counted from the end.
The target size must be at least the source size (no truncation).
If it is larger, the remaining space is filled with zero bytes.
If the target position is beyond the filled space, zero bytes are
prepended.

The chunks slices may overlap;
in this case, it works like an extra buffer is used

Returns the offset of the next byte behind the area written to.

Attributes .lock, .shut are checked and .revs, .filled are set.

TAVPL_tavlib.tav

give until void (val)  [TAVLIB.TAV]
Wrap a function result (or other expression) into a scan.
Repeats until the value (val) is void (or a fault item).
Result of this function is (val).

give while positive (val)  [TAVLIB.TAV]
Wrap a function result (or other expression) into a scan.
Repeats while the value (val) is greater than zero (or a fault item).
Result of this function is (val).

give while (cond) value (val)  [TAVLIB.TAV]
Wrap a function result (or other expression) into a scan.
Repeats while (cond) is true (or (val) ia a fault item).
Result of this function is (val).

maximum of (trm)  [TAVLIB.TAV]
Return the largest value of a tuple, row or map
The values must be comparable by '>'
If there are no values, void is returned
If not a row, tuple or map, returns the argument

max of (trm)  [TAVLIB.TAV] Deprecated.
Alias for: maximum of (trm)

max (vals)  [TAVLIB.TAV] Deprecated.
Alias for: maximum of (trm)

tuple (@) max  [TAVLIB.TAV]
Alias for: maximum of (trm)

row (@) max  [TAVLIB.TAV]
Alias for: maximum of (@)

map (@) max  [TAVLIB.TAV]
Alias for: maximum of (@)

minimum of (trm)  [TAVLIB.TAV]
Return the smallest value of a tuple, row or map
The values must be comparable by '<'
If there are no values, void is returned
If not a row, tuple or map, return the argument

min of (trm)  [TAVLIB.TAV] Deprecated.
Alias for: minimum of (trm)

min (vals)  [TAVLIB.TAV] Deprecated.
Alias for: minimum of (trm)

tuple (@) min  [TAVLIB.TAV]
Alias for: minimum of (trm)

row (@) min  [TAVLIB.TAV]
Alias for: minimum of (@)

map (@) min  [TAVLIB.TAV]
Alias for: minimum of (@)

from (start) upto (last) give tuples  [TAVLIB.TAV]
Generate permutations of integer numbers
(start) and (last) must be tuples with the same number of elements.

from (1,2) upto (2,4) give tuples
delivers in that order:
 (1,2), (2,2), (1,3), (2,3), (1,4), (2,4)

is (val) in (src)  [TAVLIB.TAV]
check for values in a bunch
if (src) is a tuple, try for every element.
Otherwise, shortcut for
    src::find val ~= ()

new row (tagname)  [TAVLIB.TAV]
Create a tagged row.
Shortcut for:
    rv =: new row
    rv.tag := tagname
Note that the shortcut row factory [a, b, ...]
is 'tuple a, b, ... as row'

new row (tagname) size (sz)  [TAVLIB.TAV]
Create a tagged row wit an initial size.
Shortcut for:
    rv =: new row size int
    rv.tag := tagname

row (@) copy lean  [TAVLIB.TAV]
Copy a row's values and keep the keys (no renumbering).
For the latter, used 'row () shrink' (modifies, does not copy).
Fields and the tag are void (not copied).

row (@) copy  [TAVLIB.TAV]
Copy a row's values and keep the keys (no renumbering).
For the latter, used 'row () shrink' (modifies, does not copy).
Fields are preserved (but not a tag, as it cannot be changed).

row (r) clone  [TAVLIB.TAV] Deprecated.
No documentation

row (@) compact  [TAVLIB.TAV]
Compact row cells in-place so that void entries are removed
by renumbering  the keys, starting at .First.
If there are no void cells, nothing is changed.
No space is released (as common with rows),
but .Last set to the index of the last non-void cell
or to .First-1 if all are void.
setting @[] etc then re-uses the already allocated memory.
Returns the input row for convenience and compatiblity

row (@) shrink  [TAVLIB.TAV] Deprecated.
Remove void entries
old version works on a copy

row (@) from (from) upto (upto)  [TAVLIB.TAV]
Copy a part of a row from (from) to (to)
All void elements are discarded
There is no check that (from <= row.first) or (upto >= row.last);
and all void elements are discarded,
i.e. all non-void elements starting with (from) are copied
from index 1 on to a new row, upto (upto) as last index processed.
Neither fields nor a tag are copied.
Works for tuples alike.

row (@) append (rmt)  [TAVLIB.TAV]
Append many values at the end of an existing row:
    ?# val =: bunch rmt give values
        @[] =: val
New keys are created for the appended values from .Last+1 on.
Append a single value by 'r[] =: val'.
'row r append r' is possible and duplicates the entried.
'row r append r, ' creates a cylic link (memory leak)

row (@) stow (rmt)  [TAVLIB.TAV]
Stow new values at void cells until filled, then append.
The values are taken from a row, map or tuple (rmt).
Does not change the keys for the non-void cells.
For large rows with a few void cells, just appending and
skipping keys with void values may be more efficient.
For a single value, use a tuple with one element.
'row r stow r' is possible and duplicates the values.

row (@) dedup bursts  [TAVLIB.TAV]
Voids duplicate values in a row with adjacent duplicates (sorted).
Returns immediately if there are none (.Count = .Last - .First + 1)
The row is scanned from first to last, and for each sequence
of equal values, all but the first one are set void.
Thus the keys are not renumbered.
Often used in the sequence
    row this sort ascending
    row this dedup bursts
    row this compact
Use the slower 'row () dedup' if unsorted

row (@) dedup sorted  [TAVLIB.TAV] Deprecated.
Alias for 'row () dedup bursts'

row (@) dedup  [TAVLIB.TAV]
Voids duplicate values in any (unsorted) row in-place.
Returns immediately if there are none (.Count = .Last - .First + 1)
The row is scanned from first to last,
and each value is searched in the remaining part,
deleted if found (by guarded equality '?=')
Often used in the sequence
    rok =: map @ keys
    row rok dedup
Use 'row () dedup bursts' if sorted.

row (@) dedup using (func)  [TAVLIB.TAV]
Voids duplicate values in a row, using a callback for comparison.
The row is scanned from first to last,
and each value is searched in the remaining part,
and deleted if found equal, as determined by (func)
with two parameters returning a boolean value,
when true (?+), the cell with the second value is voided.
Often used in the sequence
    rov =: row r values
    row rov dedup using `tuple (a) equals (b) first`

row (@) dedup using (func) with (extra)  [TAVLIB.TAV]
Voids duplicate values in a row, using a callback for comparison.
The row is scanned from first to last,
and each value is searched in the remaining part,
and deleted if found equal, as determined by (func)
with three parameters returning a boolean value,
when true (?+), the cell with the second value is voided.
The first two are the items to compare, and the third is passed
from the call as extra parameter.
Often used to have unique keys in:
    rok =: map @ pairs
    row rok dedup using `tuple (a) equal (b) cell (n)` with 1

row (@) keys  [TAVLIB.TAV]
Provide the keys with not void values as a row

row (@) values  [TAVLIB.TAV]
Provide the not void values of a row as a row

row (@) find (val)  [TAVLIB.TAV]
Search a row for the (first) key of a value (val)
Return the key (index) if found, or void if not found.
Guarded equality (?=) is used, thus the row may have mixed items.
The keys are probed in ascending order until the first found.

row (@) find (val) all  [TAVLIB.TAV]
Search a row for all keys of a value (val)
Return a row of keys; with .count = 0 if none found.
Guarded equality (?=) is used, thus the row may have mixed items.
All keys are probed in ascending order.

tuple (@) find (val)  [TAVLIB.TAV]
Search a tuple for a value (val)
Return the key (index) if found, or void if not found.
Uses simple search in ascending order of natural numbers
and guarded comparison.

row (@) sort pairs (n) ascending  [TAVLIB.TAV]
Sort a row with pairs of values for ascending pair's first elements.
Shortcut for
    row @ sort using `tuple (p) greater (q) cell (n)` with n

row (@) sort pairs (n) descending  [TAVLIB.TAV]
Sort a row with pairs of values for ascending pair's first elements.
Shortcut for
    row @ sort using `tuple (p) greater (q) cell (n)` with n

tuple (p) greater (q) cell (n)  [TAVLIB.TAV]
Compare (n)-th cell of tuples
Returns ?+, (), ?-  if greater, equal or less
Used as a callback in sort.
Not a class function, use direct expression, e.g. p[n] = q[n]

tuple (p) less (q) cell (n)  [TAVLIB.TAV]
Compare (n)-th cell of tuples
Returns ?+, (), ?- if less, equal, greater
Used as a callback in sort.
Not a class function, use direct expression, e.g. p[n] = q[n]

tuple (p) equal (q) cell (n)  [TAVLIB.TAV]
Compare (n)-th cell of tuples
Uses guarded compare (?=) for any kind of item.
returns boolean ?+ , ?-
Used as a callback in dedup.
Not a class function, use direct expression, e.g. p[n] ?= q[n]

tuple (@) append (val)  [TAVLIB.TAV]
Create a new tuple with one more element, (val).
To add more than one, use 'row () append ()' and convert to a tuple.
Consider using a row in the first place instead of the immutable tuple.

tuple (@) from (from) upto (upto)  [TAVLIB.TAV]
Slice a tuple.
Alias for
    row (row @ from from upto upto) as tuple

row (@) as map  [TAVLIB.TAV]
Create a new map from a (sparse) row (or tuple)
using the integer keys, ignoring void cells.

as map row (row)  [TAVLIB.TAV] Deprecated.
Alias for: row (row) as map

row (@) push (val)  [TAVLIB.TAV]
Push a non-void value to a row used as stack
As the '.count' attribute is used, values may not be void.
To create a stack, just create a row and push the first value.

row (@) pop  [TAVLIB.TAV]
Pop the top value of a row used as stack.
As void cannot be pushed, returns void if exhausted.
see: row (@) push (val)

new map (tagname)  [TAVLIB.TAV]
Create a tagged map, shortcut for:
    rv =: new map
    map.Tag =: tagname
Note that tags may be set only once.

map (@) value key pairs as row  [TAVLIB.TAV]
Provide a row of value-key-pairs (unsorted)
Implemented as:
    pairs =: new row size @.count
    ?# key =: map @ give keys
        pairs[] =:@{key}, key
    :> pairs
Sorting by value is simple due to the comparison rules for tuples:
    row (map @ value key pairs as row) sort fast ascending

as map pairs (tup)  [TAVLIB.TAV] Deprecated.
Alias for: tuple (tup) as map

tuple (tup) as map by pairs  [TAVLIB.TAV] Deprecated.
Alias for: tuple (tup) as map

as map tuple pairs (tup)  [TAVLIB.TAV] Deprecated.
Alias for: tuple (tup) as map

map (@) add pairs (rmt)  [TAVLIB.TAV]
Add to a map pairs of key and value, from a row, map or tuple.
Just a shortcut for:
    ?# lv =: bunch rmt give values
        @{lv.1} =: lv.2

map (@) copy lean  [TAVLIB.TAV]
Copy a map without fields.

map (@) copy  [TAVLIB.TAV]
Copy a map including fields efficiently.
Uses 'map () copy lean'.
Fields are preserved (but not a tag, as it cannot be changed).

map (@) as string key (delim) join (sep) quote (qr)  [TAVLIB.TAV]
Returns a string of key-value-pairs for a map
The keys and values must be plain,
i.e. numbers or strings or booleans.

Keys and values are joined using string (delim), default '=',
pairs are connected by string (sep), default blank ' '.
Both should be strings.

String values are enclosed by calling 'string (str) wrap (qr)',
but here with the default '"' for (qr).

map (@) find (val)  [TAVLIB.TAV]
Search a map for a key with value (val)
Return the key if found, or void if not found.
Guarded equality (?=) is used, thus the row may have mixed items.
The keys are probed as given by 'map @ give keys'.

map (@) find (val) all  [TAVLIB.TAV]
Search a map for all keys with value (val)
Return a row of keys; with .count = 0 if none found.
Guarded equality (?=) is used, thus the row may have mixed items.
All keys are probed as given by 'map @ give keys'.

map (@) invert  [TAVLIB.TAV]
Invert a map:
The values are the new keys, the keys are the values.
If a value has more than one key, a tuple is used to hold all keys.
If the result's count is smaller than the input's, there are tuples.

file (filename) lines  [TAVLIB.TAV]
Read file (filename) as lines into a row
If there is an error, the fault item received is returned unprocessed;
just the row of lines read so far is saved
in the .data attribute of the fault item

row of lines from file (filename)  [TAVLIB.TAV] Deprecated.
Alias for: file (filename) lines

file (filename) row of lines  [TAVLIB.TAV] Deprecated.
Alias for: file (filename) lines

file (filename) give lines  [TAVLIB.TAV]
Generates the lines of the file (filename) as a scan.
End-of-file is returned as void.
If the filename is void, standard input is used.
Fault items of lower level functions are given back as value.
In order to avoid infinite loops, fault items are only
returned once; the second call results in an assertion violation.

give lines from file (filename)  [TAVLIB.TAV] Deprecated.
Alias for: file (filename) give lines

file standard input give lines  [TAVLIB.TAV]
Generates the lines from standard input
See 'file (filename) give lines'

give lines from standard input  [TAVLIB.TAV] Deprecated.
Generates the lines from standard input
See 'file (filename) give lines'

network url (url) give lines  [TAVLIB.TAV]
Gives the lines obtained from an URL.
End-of-file is returned as void.
For URL types and error codes, see 'man curl'
Uses a shell pipe and the 'curl' program,
thus only if shell access is allowed.

directory (dir) give filenames  [TAVLIB.TAV]
Give the filenames in directory (dir) in directory order.
Returns a fault item if directory does not exist.
To scan sorted, use
    dr =: sort directory dir filenames
    ?# fn =: row dr give values

give filenames of directory (dir)  [TAVLIB.TAV] Deprecated.
Alias for: directory (dir) give filenames

directory (dir) filenames  [TAVLIB.TAV]
Directory (dir) filenames unsorted as row.
Returns a fault item if directory does not exist.

row of filenames from directory (dir)  [TAVLIB.TAV] Deprecated.
Alias for: directory (dir) files

directory (dir) newest (pattern)  [TAVLIB.TAV]
Return the newest file in (directory)
that matches a filename (pattern)
as by: string (string) matches filename (pattern)
Void (directory) is the current directory '.'
Time stamp used is last modification time.
Fault items are passed unchanged.

command string (cmd) give lines  [TAVLIB.TAV]
Generate the resulting lines when executing the command string (cmd) by the shell.
See 'quote (str) for shell' to protect special characters.
Fault items are given back as value.
In order to avoid infinite loops, fault items are only
returned once; the second call results in an assertion violation.
If the command string contains newline characters,
the shell may execute more than one command.

command (cmd) give lines  [TAVLIB.TAV]
Alias for: command string (cmd) give lines
Put the variable in parenthesis if not found:
stream =: 'uname -a'
?# line =: command (stream) give lines

give lines of command (cmd)  [TAVLIB.TAV] Deprecated.
Alias for: command (cmd) give lines

command string (cmd) lines  [TAVLIB.TAV]
Execute string (cmd) via the shell,
collect the output lines in a row and return this row
If an error occurs, the lines obtained so far
are in the '.data' attribute of the fault item.
If the string contains newlines, the shell may execute
more than one command.

command (cmd) lines  [TAVLIB.TAV]
Alias for: command string (cmd) lines
Put the variablle in parenthesis if not found:
 stream =: 'uname -a'
 row =: command (stream) lines

row of lines from command (cmd)  [TAVLIB.TAV] Deprecated.
Alias for: command (cmd) lines

command (cmd) row of lines  [TAVLIB.TAV] Deprecated.
Alias for: command (cmd) lines

string (@) quote for shell  [TAVLIB.TAV]
Quote shell meta characters by backslash.
The result is not to be enclosed in quotes.

string (@) has character (c)  [TAVLIB.TAV]
Test if the single character (c) is in a string
Wrapper for: string (str) locate (c), returning boolean
Intended for optimisation if c is a single character

has string (str) character (c)  [TAVLIB.TAV] Deprecated.
Alias for: string (str) has character (c)

is character (c) in string (str)  [TAVLIB.TAV] Deprecated.
Alias for: string (@) has character (c)

string (@) count from (start) many of (accept)  [TAVLIB.TAV]
Count in a string from (start) the characters found in (accept).
Zero is returned if the character at start is not in (accept),
or if start is beyond the end.
Negativ (start) counts from the end (-1 is last);
if before the begin, 1 is used.
Zero (start) is an assertion violation.

string (@) count from (start) none of (reject)  [TAVLIB.TAV]
Count in a string from (start) the characters not found in (reject).
Zero is returned if the character at start is in (reject),
or if (

string (@) from (start) many of (accept)  [TAVLIB.TAV]
Clip from a string the longest part with characters in (accept),
starting at (start).
If none is found, or 'start' is behind the end,
the empty string is returned.
Negativ (start) counts from the end (-1 is last).
Zero (start) is an error.

string (str) clip from (start) many of (accept)  [TAVLIB.TAV] Deprecated.
Alias for 'string () from (start) many of (accept)'

string (@) from (start) none of (reject)  [TAVLIB.TAV]
Clip from a string the longest part with characters not in (reject),
starting at (start).
If none is found or 'start' is behind the end,
the empty string is returned.
Negativ (start) counts from the end (-1 is last).
Zero (start) is an error.

string (str) clip from (start) none of (reject)  [TAVLIB.TAV] Deprecated.
Alias for: string ()  from (start) none of (reject)

string (@) give clips by any of (sep)  [TAVLIB.TAV]
Give clips of a string separated by any single character in (sep).
If two separators follow directly, an empty string is returned,
also for leading and trailing separators.
If the target is the empty string, nothing is given.

string (@) give clips by many of (seps)  [TAVLIB.TAV]
Give clips of a string separated by any combination of characters in (seps).
An empty string is returned only if there is a leading or trailing
separator character.
If it is the empty string, nothing is given.
See also 'string (@) give clips by any of (seps)'

string (@) give clips by (seps)  [TAVLIB.TAV]
Give clips of string separated by strings (seps),
which is either a tuple or row of strings, or a single string.
If two separators follow directly, or are head or tail,
an empty string is returned.
If one delimiter is the prefix of another one,
either may be used (not necessarily the longest one).
No delimiter may be the empty string.

string (@) split by any of (seps)  [TAVLIB.TAV]
Split a string into an row of strings
using any of the single characters from (seps) as separators.
If two separators follow directly, or are leading or trailing,
an empty string is provided (not a void).
The empty string returns a row without elements
Uses 'string (str) give clips by any of (seps)' to fill the row.

string (@) split by many of (seps)  [TAVLIB.TAV]
Split a string into an row of stings
using any combination of the characters in (seps) as separators.
If separators are leading or trailing, or are leading or trailing,
an empty string is provided (not a void).
The empty string returns a row without elements
Uses 'string @ give clips by many of seps' to fill the row.

string (@) split by (seps)  [TAVLIB.TAV]
Split a string into an row of strings using (seps),
which is either a tuple or row of strings, or a single string.
using any one of the string(s) given by (seps) as separator,
which is either a single string or a tuple or row.
If two separators follow directly,  or are leading or trailing,
an empty string is provided (not a void).
The empty string returns a row without elements.
Uses 'string str give clips by any of seps' to fill the row.

string (@) from (pos) has (what)  [TAVLIB.TAV]
Tell if a string  has string (what) at position (pos)
If (what) is a tuple of strings, each is probed,
and the first match is a success.
Wrapper around 'cue = string str from pos length cue.count'

is string (key) in (tgt) from (pos)  [TAVLIB.TAV] Deprecated.
Alias for: string (str) from (pos) has (key)

string (@) has head (head)  [TAVLIB.TAV]
Check if string (str) starts with the string (head).
(head) may be a tuple of strings; first match is a success
Wrapper for:
    string () from 1 has head

has string (str) head (head)  [TAVLIB.TAV] Deprecated.
Alias for: string (str) has head (head)

is string (head) head of (str)  [TAVLIB.TAV] Deprecated.
Alias for: string (str) has head (head)

is string (head) starting (str)  [TAVLIB.TAV] Deprecated.
Alias for: string (str) has head (head)

string (@) has tail (tail)  [TAVLIB.TAV]
Check if a string ends with the string (tail).
(tail) may be a tuple of strings; any match is a success

is string (tail) tail of (str)  [TAVLIB.TAV] Deprecated.
Alias for: has string (tail) tail (str)

is string (tail) ending (str)  [TAVLIB.TAV] Deprecated.
Alias for: has string (tail) tail (str)

string (@) untab (ts)  [TAVLIB.TAV]
In string (@), replace all tab characters by blanks
to advance the next tab position, i.e. pos %% ts = 1

string (@) as character row  [TAVLIB.TAV]
convert a string to a row of (single character) strings

row (@) join values as string  [TAVLIB.TAV]
Join cell values of a row to a string without separators.
The cell values are in ascending order of the row keys.
As string concatenation converts numbers,
the cell values of the row may be strings or numbers or both.
Void cell values are skipped.

row (@) join values by (sep)  [TAVLIB.TAV]
Join cell values of row (row) to a string with separator (sep).
The cell values are in ascending order of the row keys.
As string concatenation converts numbers,
the cell values of the row may be strings or numbers or both.
Void cell values are skipped.

row (@) join keys by (sep)  [TAVLIB.TAV]
Join all keys (with nonvoid values) in a row
to a string with separator (sep).
The keys are in ascending order.

join (rmt)  [TAVLIB.TAV]
Catenate all values of a s, map or tuple with blank as separator.
Values are converted to strings by the string catenation.
See: join () by ()

join (rmt) by (sep)  [TAVLIB.TAV]
Catenate all values of a row, map or tuple with (sep) as separator.
Values are converted to strings by the string catenation.
No individual versions for rows, tuples or maps necessary,
as 'bunch () give values' resolves it.

map (@) join keys by (sep)  [TAVLIB.TAV] Deprecated.
Join all keys of a map to a string,
separated by (sep), in undefined order

map (@) join values by (sep)  [TAVLIB.TAV]
Join all values of a map to a string, separated by (sep).
Standard scan is used, thus the order is undefined.

string (@) without leading (chars)  [TAVLIB.TAV]
Remove from the beginning of a string all characters
that are in (chars), and return the resulting string.

clip (str) without leading (chars)  [TAVLIB.TAV] Deprecated.
Alias for: string (@) without leading (chars)

string (@) without leading whitespace  [TAVLIB.TAV]
Remove all leading whitespace from a string.
Shortcut for
    string @ without leading #Whitespace

clip (str) without leading whitespace  [TAVLIB.TAV] Deprecated.
Alias for: string (@) without leading whitespace

string (@) without trailing (chars)  [TAVLIB.TAV]
Remove from the end of a string all characters
that are in (chars), and return the resulting string.

clip (str) without trailing (chars)  [TAVLIB.TAV] Deprecated.
Alias for: string (str) without trailing (chars)

string (@) without trailing whitespace  [TAVLIB.TAV]
Remove all trailing whitespace from a string.
Shortcut for
    string str without trailing #Whitespace
so beware of redefining the named constant from the standard library

clip (str) without trailing whitespace  [TAVLIB.TAV] Deprecated.
Alias for: string (str) without trailing whitespace

string (@) quoted  [TAVLIB.TAV]
Put a string in Quotes.
Quotes inside are escaped as '"',
and '"' is replaced by '&quot;' before.
Numbers instead of a string are converted to strings.

quote (string)  [TAVLIB.TAV]
Alias for: string (string) quoted

string (@) wrap (wrap)  [TAVLIB.TAV]
Enclose a string by (wrap)
If (wrap) is a string, any occurence of (wrap) inside is doubled,
    then the result enclosed in (wrap)
If (wrap) is a tuple, returns 'wrap.1 _ arg _ wrap.2',
if (wrap) is a reference to a function (with one parameter),
    the return value is returned, thus should be a string.
    The function must handle all kinds of arguments.

See `string () quoted` for escaping '&' for HTML.

integer (@) as string base (basespec)  [TAVLIB.TAV]
Convert integer (@) using arbitrary digit characters from (basespec).
The number of characters in (basespec) determines the base:
'012356789' is decimal
'0123567' is octal,
'0123456789ABCDEF' is hexadecimal, as is '0123456789abcdef'
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' is base 36
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' is base 62,
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' is base 64

It is recommended to use ASCII 7 bit without controls,
i.e. max. 96 characters, so that the code points are smaller than the basespec.
If duplicate digits are present, the result is undefined.
If the input number is negative, a '-' is prefixed.

If 'basespec' is an integer instead of a string, it must be between 2
and 62 or 64. Unless 64, the above string for basespec 62 is used,
otherwise the altenate string for basespec 64.

If 'basespec' is void, 10 is used.

string (@) as integer base (basespec)  [TAVLIB.TAV]
Convert a string to an integer by (basespec)

If (basespec) is an integer between 2 and 62, digits, capital letters
and small letters are used (in this order);
if it is 64, the characters are
    'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
To have hex digits with small letters, use '0123456789abcdef'

If (basespec) is a string, its characaters are used as digit characters;
the base is the number of characters.

If (basespec) is void, decimal digits are used (base 10).

Integer (basespec) may not be <2, 63 or > 64.
String (basespec) may be of arbitray length;
if there are duplicate characters, the result is undefined.

In the input (str), a leading '-' is used as sign,
so its use as a digit character is undefined.

Blank space or any charcters in the input string that are not in
the base string are not allowed, and a fault item is returned.

Upper and lower case are distinguished, thus hex digits may not
contain lower case letters (but see 'string (str) as integer literal')

string (@) as integer  [TAVLIB.TAV]
Integer conversion for strings with decimal digits.
Alias for 'string str as integer base ()'

as integer (str)  [TAVLIB.TAV]
Alias for: string (str) as integer
use 'as clib integer (str)' if 0x and leading zeros should be possible

string (@) as integer ignore (ign)  [TAVLIB.TAV]
String to integer conversion ignoring characters
given in (ign), e.g. spaces, underscores, apostrophes
Just first removes each character in (ign)
before the conversion.
(ign) can be void or the empty string.

string (@) as integer ignore (ign) else (repl)  [TAVLIB.TAV]
String to integer conversion ignoring characters in (ign)
before conversion.  If it still is not valid,
use the alternate (else).
(ign) can be void or the empty string.

string (@) as integer literal  [TAVLIB.TAV]
Integer conversion for literals in TAV (or Python3) format:
Either (decimal) digits (including leading zeroes),
or 0xABC for hex, 0o765 for octal, or 0b01001 for binary.
Returns either an integer
or a fault item provided by string () as integer base ()
Apostrophes and underscores are removed prior to conversion.

string (@) as integer else (default)  [TAVLIB.TAV]
Integer conversion for decimal, octal or hexadecimal strings
in integer literal notation (same as in Python 3) ,
i.e. decimal digits or 0x1Ab or 0o127 or 0b010101,
and supplying a default value if the string
fails to convert;
see 'string () as integer literal.
Void returns the default (which may be void)

as integer (str) else (default)  [TAVLIB.TAV]
Alias for: string (str) as integer else (default)

string (@) as float else (default)  [TAVLIB.TAV]
Floating point conversion for decimal strings
and supplying a default value if the string is not a float
void returns the default (which may be void)

string (@) as integer decimal  [TAVLIB.TAV]
Convert a string to an integer number for decimal digits only,
by calling 'integer from  str base 10' and ignoring faults;
faulty or empty strings return void.

string (@) case flipped  [TAVLIB.TAV]
Flip in a string all upper to lower case characters and vice versa.
Call 'set locale' to include non-ASCII characters

string (@) case is upper  [TAVLIB.TAV]
check if whole string is upper case
umbrella for '@ = string @ case to upper'

string (@) case is lower  [TAVLIB.TAV]
check if whole string is lower case
umbrella for '@ = string @ case to lower'

string (@) group (gm)  [TAVLIB.TAV]
Group decimal digits in a string.
If there is a decimal point, grouping starts there in both
directions, otherwise at the end.
The parameter (gm) may be a pair of the group character
and the number of digits to group; if not a pair, 3 is assumed.
From the start point, the group character is inserted
before resp. after each fourth decimal digit in a row,
so application to an already grouped string does not change it.
If (gm) is void, "'" is used.
If the input is a tuple (neither row nor map),
a tuple is returned with each element grouped
If the input is not a string, it is converted by string catenation.
Beware that floting point numbers have only a few digits per default.

string (@) group  [TAVLIB.TAV]
Alias for 'string (str) group ()'

group (str) by (gm)  [TAVLIB.TAV] Deprecated.
Alias for 'string (str) group (gm)'

group (str)  [TAVLIB.TAV] Deprecated.
Alias for 'string str group ()'

string (@) replace character at (pos) by (repl)  [TAVLIB.TAV]
Replace in a string the character at the position (pos) by (repl).
The new string may be longer or the empty string.

string (@) replace at (pos) by (repl)  [TAVLIB.TAV]
Replace part of a string by a string (repl)
The replaced part begins at (pos) and has the size of (repl),
i.e. the string length is unchanged.

string (@) replace from (from) upto (upto) by (repl)  [TAVLIB.TAV]
Replace part of a string  by a string (repl)
starting at (from) ending at (upto), both inclusive.

string (@) replace each (cue) by (repl)  [TAVLIB.TAV]
Replace in a string all occurences of string (cue)
by the string (repl).
If (cue) is a tuple, the function is called for each element.
(see alternatively 'string (@) replace many (pairs)').
The scan continues after the replacement.
If there is no replacement, the original string is returned;
to determine this case, use equality comparison.
If (cue) is void or the empty string, nothing is done
and the original string returned.
If

string (@) replace each of (cue) by (repl)  [TAVLIB.TAV]
Replace in a string each of the characters in (cue) by (repl).
If (cue) is a string with more than one character,
the string replacement is called for each character,
one after the other,  thus different to the replacement if (cue) is a tuple.
Otherwise call string replacement with cue directly.
Beware of characters in (cue) also in (repl).

replace each (cue) by (repl) in string (target)  [TAVLIB.TAV] Deprecated.
Alias for:
    string (target) replace each (cue) by (repl)

string (@) replace many (pairs)  [TAVLIB.TAV]
Replace in a string several parts in one run,
using a tuple (or row or map) of (cue, repl) pairs.

The pairs in the tuple or row are probed in ascending order
for a match; for the first one found, the cue is replaced,
and the scan continued after the replacement from the beginning again.
The cue may be the empty string; then the replacement is inserted
after each character.
If a cue is a prefix for another cue, it must be placed second;
there is no longest match etc.

For a map, the keys are searched and replaced by the values.
The keys are used as provided by the key scan,
in hard to predict order (mostly last used first).
Thus, none of the keys should be the prefix of another one.

Example:
    s =: "the quick fox jumped"
    print string s replace many  'the'->'der', 'fox'->'fuchs'

This simple approach has the advantage of easy predictability
in performance and result.

string (@) replace first (cue) by (repl)  [TAVLIB.TAV]
Replace in a string the first occurence of (cue) by (repl)
If there is no replacement, (str) is returned;
to determine this case, use equality comparison.

string (@) without head (head)  [TAVLIB.TAV]
If the string starts with (head), return the tail,
else the string unchanged.

string (@) encode numeric entities  [TAVLIB.TAV]
Replace all numeric HTML entities by the corresponding Unicode character
i.e. '&#nn;' by the code point nn

string (@) give characters  [TAVLIB.TAV]
Give each character in a string individually.

string (@) as map by pairs  [TAVLIB.TAV] Deprecated.
Create a map from key-value pairs in a string, e.g.
map =: to map by pairs 'a=9 b:"x" c=3.0'
The key-value connector character set is many of '=:',
the pairs separated by whitespace.
Intended to create maps from  literals.
Preliminary version, (quoted) values may not yet contain whitespace
or quotes, and no comma or semicolon as separator.

as map string pairs (str)  [TAVLIB.TAV] Deprecated.
Alias for: string (str) as map by pairs

row (@) parse options values (valopts)  [TAVLIB.TAV]
Parse options in an argument row
The argument row is scanned for option entries starting with a minus sign
until a double minus single entry is found.

Options found are collected in a result map,
either with the corresponding value, or with '?+' as true.

All processed cells are voided in the supplied row;
thus, scanning the row delivers the remaining arguments.
If a row without voids is desired, apply 'row () compact'.

Options may be newer long options, starting with a double minus,
the tag optionally followed by an equals sign and a value.

If old style single letter options with values are used,
a string of characters must be provided in 'valopts' to identify these.
Using new style options is recommended instead.

The caller must handle new and old option aliases.

string (@) parse query  [TAVLIB.TAV]
Parse a Query String as produced by HTML Forms

After splitting by '&', each element is checked
for the format 'key=value' and the pair stored in an map.
As positional parameters are rather seldom,
these are collected in an row under .posparms

Conversion of special characters in the %xx format
is done after splitting in fields, keys and values,
just after replacing '+' by ' '

parse query string (str)  [TAVLIB.TAV] Deprecated.
Alias for: string (str) parse query

map (@) give keys ascending  [TAVLIB.TAV]
Generate the keys of the map 'map' in ascending order
(as opposed to 'give () keys', which lists in undefined order)
The keys should be ASCII strings or numbers.

map (@) give keys descending  [TAVLIB.TAV]
Generate the keys of the map (ary) in descending order
(as opposed to 'give () keys', which lists in undefined order)
The keys should be ASCII strings or numbers.

map (@) give keys using (func) with (extra)  [TAVLIB.TAV]
Generate the keys of the map 'ary' ordered,
same as 'map (@) give keys using (func)',
but here the func has a third parameter, the user data (extra),
which allows `tuple () greater () with ()' for cell selection.

map (@) give keys using (func)  [TAVLIB.TAV]
Generate the keys of the map 'ary' ordered
(as opposed to 'give () keys', which lists unsorted)
The function (func) must have two parameters to compare
and deliver ?+, () or ?-, where ?+ is for "greater",
void for equal, and ?- else.

map (@) give keys ascending values  [TAVLIB.TAV]
Supply the keys of a map in ascending order
with respect to the values stored.

map (@) give keys descending values  [TAVLIB.TAV]
Supply the keys of map (@) in descending order
with respect to the values stored.

map (@) keys by value (val)  [TAVLIB.TAV]
Get map key(s) by value.
If there is none, void is returned.
If there is only one, the key is returned.
Otherwise, it is a tuple of keys.

format (fmt) (list)  [TAVLIB.TAV]
Format a (list of) expression(s) according to a format string (fmt).

The format string is copied until a percent sign ('%') is found
that starts a formatted insertion of a values.
If another percent sign follows directly, it is copied and the other one ignored.
Otherwise, the insertion specification ends at a (mandatory) semicolon.

If initally a decimal number n is followd by a colon, the n-th element
from the list of expressions is converted (may be void, shown as '()').
Otherwise, the ordinal number of the field is used.

Any number of non-digits may follow; they are set aside as flags.

A decimal number indicates the minimum field width.
If the conversion result is smaller, it is padded with blanks
or the character indicated by a flag.
If absent, no padding is used.

A point ('.') followed by a decimal number gives the
precision for floats and maximum field width otherwise.

The field is terminated by a semicolon.
If none is found, or a percent sign encountered before,
the format string is returned unchanged which serves
as error indicator.

Flags are:
    -   pad to the right, i.e. the result is left adjusted
    +   use a plus sign for positive numbers (and zero)
    0   pad with zeroes to the left, no padding to the right
    p   pad with points in both directions
    ·   pad with Unicode '·' (&middot;) in both directions
    "   Encloses in (double) quotes after truncation
    '   group the result by "'" (see 'group' function)
    _   group the result by "_" (see 'group' function)
    ⏨   use Unicode '⏨' instead of 'e' in exponential format
    …   use '&hellip;' to mark truncation (replace last char)
    d   use decimal digits for integer numbers
    x,X use hexadecimal digits for integer numbers
    o   use octal digits for integer numbers
    b   use binar digits for integer numbers
    f,F use fixed point format for floating-point numbers
    e,E use exponential format for floating-point numbers
    g,G use fixed format for small and expoential for large floats

The result of conflicting flags is undefined.
Flags not applicable are silently ignored.

See also the function
    format convert (src) width (width) prec (prec) mods (mods)

system get environment (key)  [TAVLIB.TAV]
Get single environment variable (key).

get environment value of (key)  [TAVLIB.TAV] Deprecated.
Alias for: system get environment

system on exit call (funcref) using (parm)  [TAVLIB.TAV]
Register a function reference (funcref) to be called at normal exit
in reverse order of registering, providing a parameter.

If more than one parameter is needed, use a tuple;
if none is required, use one and supply void.

Functions are unique; if the same function is specified again,
just the parameter is changed, which can be void.

To delete a function, use 'system on exit remove (funcref)'

The returned item reference of the called function is ignored,
unless it is a fault item, which is a fatal error.

Doing anything else than cleanup is considered sinful,
in particular calling 'system exit ()' supressing more exit
functions.

The item supplied as parameter keeps refernced

system on exit remove (funcref)  [TAVLIB.TAV]
Delete a registered system function

math base (base) exp (exponent) by square and multiply  [TAVLIB.TAV]
Integer exponentiation via square and multiply.
Base may be integer or rational, exponent non-negative integer.
Same result as base^exponent

math int (n) is square  [TAVLIB.TAV]
Tell if argument is a square number
using library square root
speed up by checking (hex) end digit (only 0, 1, 4 or 9)

math gcd (tup)  [TAVLIB.TAV]
Greatest Common Divisor of integer numbers
argument is a tuple of positive integers, e.g. a pair
if not a tuple, the argument is returned as-is

math int (e) root (n)  [TAVLIB.TAV]
Integer root for integer exponent:
result {r} to the power of {e} is less or equal {n}
     r^e ≤ n
if {e}=2, then 'math int sqrt' is used.
uses bisection method, i.e. accumulates powers of two

random next float  [TAVLIB.TAV]
Next floating point random number in the range [0..1[
by random next integer / $SYSTEM.randmax after float conversion

TAVPL_crypto.c

string (key) encrypt salt (salt)  [CRYPTO]
Encrypts upto 8 characters (lower 7 bit) of a key string
 using salt characters to make decrypting more difficult.
 If salt is void, the time of day is used obfuscated.
 The result are 2 salt characters, followed by 11 characters encoding 56 bit

encrypt password (key) with salt (salt)  [CRYPTO] Deprecated.
Alias for: string (key) encrypt salt (salt)

random next integer noisy  [CRYPTO]
read true random number from /dev/urandom

string (string) as MD5 chunk  [CRYPTO]
calculate MD5 checksum of a string
the result is a 16 byte chunk

string (string) as MD5 hex  [CRYPTO]
calculate MD5 checksum of a string
the result is a string of 32 hex characters

string (string) as MD5 compact  [CRYPTO]
Calculate MD5 checksum as a compact encoding
that can be used as a word or identifier.
The result is a string of 24 capital and small letters,
starting with a capital letter.
The MD5 sum is split into 16 bit chunks,
each converted to 3 characters using base-52 encoding
starting with a capital letter,
because 2^16 / 52^2 = 24.2

string (string) as SHA1 chunk  [CRYPTO]
calculate SHA1 checksum of a string
the result is a 20 byte chunk

string (string) as SHA1 hex  [CRYPTO]
calculate SHA1 checksum of a string
the result is a string of 40 hex characters

string (string) as SHA1 compact  [CRYPTO]
Calculate SHA1 checksum as a compact encoding
that can be used as a word or identifier.
The result is a string of 30 capital and small letters,
starting with a capital letter.
The SHA1 sum is split into 16 bit chunks,
each converted to 3 characters using base-52 encoding
starting with a capital letter.

TAVPL_matrix.tav

new matrix size (dimensions) origin (origin)  [MATRIX.TAV]
Create a new matrix with dimensions (dimensions),
which is a tuple of at least two elements, all positive integers,
and whose product does not exceed the available memory.
The tuple is saved at .dimensions and must not be changed.

(origin) is either a tuple with the same number of elements
as (dimension), and gives the lowest index per dimension.
If it is an integer, a corresponding tuple is used,
if void, 1 is used.

As access to a field outside of .origin and .origin+.dimensions
would work without crash, but might expand the matrix unexpectedly,
there is no dynamic resizing as for rows;
the index range is protected by an assertion.

Refrain from changing the fields .dimensions and .origin.

new matrix size (dimensions)  [MATRIX.TAV]
Shortcut for 'new matrix size (dimensions) origin (1, 1, ...)

is (x) matrix  [MATRIX.TAV]
test if matrix

matrix (@) give keys  [MATRIX.TAV]
give the key tuples

matrix (@) print  [MATRIX.TAV]
Simple print all elements, one per line

TAVPL_readline.c

terminal read line (prompt)  [READLINE]
Obtain a line from the terminal with optional prompt message
using the readline() library
Note that no input is the empty string,
and CTRL-D returns void.
CRTL-C while in readline returns a fault.

TAVPL_xml.tav

file (filename) as XML tree  [XML.TAV]
DOM parser for well-fromed XML documents from a file.
Each node is a -- possible empty -- row of lower level nodes.
The node tag is in .tag, the attribute map in .attrs,
Character data for a node is catenated as-is in .cdata;
use a library routine to compress white space.
Outside the top node, character data is ignored.
The parent of a node is set in .parent as a proxy reference
The tag in the corresponding end element is stored in .endtag.

Comments and processing instructions are ignored.

The DOM parser uses the SAX parser, see there.

new sax parser (ctx)  [XML.TAV]
SAX parser for XML

Create a sax parser object by
    ctx := {}   \ or any other user data
    sp =: new sax parser ctx

Then set callback functions (see below):
    sp.elementBegin =: `...`
    ...

and supply document lines by
    sax (sp) supply (str)

The string (str) is used as scan buffer and parsed:
All leading characters that are not a '<' are provided
as .characterData and an empty string is returned.
Unless the buffer is empty, it now starts with a '<',
and a following '>' is searched; if there is none,
parsing is stopped and the buffer string returned to be extended.
The characters between the '<' and '>' are parsed as an element
and the corresponding callback (begin and end) is called,
and the string including '<' and '>' discarded;
if it is not an element, the string is provided via .otherElement
(including '<' and '>' and then discarded.
Unless the buffer is empty, the scan is repeated.

Thus, a typical use (without fault handling) is:
    rbt =: ''       \ residual buffer tail
    ?# lne =: give lined from file ...
        rbt =: sax sp supply rbt _ lne _ '&nl;'

The callback functions () all have the context (user data)
as first parameter:

.elementBegin
    - context (user data)
    - tag string
    - attribute map

.elementEnd
    - context (user data)
    - tag string

.characterData
    - context (user data)
    - next (piece of) character data

.otherElement
    - context (user data)
    - everything between '<' and '>' that is not an element.

Entities are not resolved, but remain as-is in the strings;
use own or library functions to convert.

Namespaces are possible, as any character not whitespace or '>' is accepted
as element or attribute name.

To stop scanning, set a flag in the context and stop the supply loop.

No check for well-formnedness is done; in particular, an end tag is not checked
against the tag name of the hierarchically corresponding begin tag;
this could be done be the caller in the .elementEnd callback.

Can be used to parse HTML if the caller checks the nesting etc.

sax (this) supply (str)  [XML.TAV]
Supply input data and process input.

TAVPL_complex.tav

new complex re (x) im (y)  [COMPLEX.TAV]
create a complex number pair

new complex (pair)  [COMPLEX.TAV]
create a complex number pair

complex (this) add (b)  [COMPLEX.TAV]
Add two complex numbers

complex (this) sub (b)  [COMPLEX.TAV]
Subtract two complex numbers

complex (this) mul (b)  [COMPLEX.TAV]
Multiply complex numbers

complex (this) div (b)  [COMPLEX.TAV]
Divide complex numbers

complex (this) abs  [COMPLEX.TAV]
Absolute value (vector length) of a complex number (single real)
i.e. sqrt x.1^2 + x.2^2

complex (this) re  [COMPLEX.TAV]
Real part of a complex number

complex (this) im  [COMPLEX.TAV]
imaginary part of a complex number

complex (this) cis  [COMPLEX.TAV]
CIS function for a real number,
Returns cos x.re, sin x.im

complex (this) arg  [COMPLEX.TAV]
Argument of a complex number (angle in radians)

complex (this) as string  [COMPLEX.TAV]
print a complex number

TAVPL_dfloat.tav

dfloat (this) add (b)  [DFLOAT.TAV]
Add two numbers in decimal float format.
The lower exponent is used, the result is exact, not rounded.
If a precision is given by the operands, the minimum is propagated.

dfloat (this) sub (b)  [DFLOAT.TAV]
Subtract two numbers in decimal float format.
The lower exponent is used, the result is exact, not rounded.
If a precision is given by the operands, the minimum is propagated.

dfloat (this) neg  [DFLOAT.TAV]
Change sign of a number in decimal float format.

dfloat (this) mul (b)  [DFLOAT.TAV]
Multiply two numbers in decimal float format.
If no precision is given, the result is not rounded and thus exact.
Otherwise, the smaller of the (not void) precision is used.

dfloat (this) div (b)  [DFLOAT.TAV]
Divide two numbers in decimal float format.
If no precision is given, the default (200) is used.
Otherwise, the smaller of the (not void) precision is used.

dfloat (this) is positive  [DFLOAT.TAV]
Test if a dfloat is > 0

dfloat (this) is negative  [DFLOAT.TAV]
Test if a dfloat is < 0

dfloat (this) is greater (b)  [DFLOAT.TAV]
Compare for greater

dfloat (this) is less (b)  [DFLOAT.TAV]
Compare for less

dfloat (this) round (p)  [DFLOAT.TAV]
Round and normalise a number in decimal float format.
If no precision is given, the default (200) is used.

dfloat (this) norm  [DFLOAT.TAV]
Normalise a number in decimal float format,
i.e. remove trailing decimal zeroes and adjust the exponent.

dfloat (this) digits (p)  [DFLOAT.TAV]
Change (or set) the precison of a decimal float.
Default precis

dfloat (this) as float  [DFLOAT.TAV]
Convert a decimal float number to standard float.
No error checking, precision is ignored.

integer (this) as dfloat  [DFLOAT.TAV]
Convert integer number to decimal float.
No rounding necessary, no precision set.
Result is normalised.

dfloat (this) as string  [DFLOAT.TAV]
Convert a decimal float to a string.
There is always a decimal point (it's not an integer),
and no extra (insignificant) trailing zeroes
-- unless there is only one nonzero decimal digit
If trailing or leading zeroes would be necessary,
an exponent is used.
The decimal point is fixed '.' (not localized)

float (this) as dfloat (prec)  [DFLOAT.TAV]
Convert a standard (binary) float to decimal float.
Parameter is the assumed precision in decimal digits,
default is sensible maximum, i.e. $SYSTEM.floatdigits (normally 15).
When larger ones are used, the extra digits are at least noisy,
see 'float (f) pair ()'.

rational (this) as dfloat (p)  [DFLOAT.TAV]
Convert rational number to decimal float
Just divides numerator by denominator,
with the precision (in decimal digits) given
or the default (if void)

new dfloat (x)  [DFLOAT.TAV]
Create a dfloat pair
from an integer, float, rational or string
using the default precisions
Void if the string was not understood.

string (this) as dfloat ignore (ign)  [DFLOAT.TAV]
Convert a string to a decimal float
At most one decimal point is allowed.
Characters in (ign) are removed first.

string (this) as dfloat  [DFLOAT.TAV]
Convert a string to a decimal float
At most one decimal point is allowed.
Alias for 'string (this) as dfloat ignore ()'

dfloat (this) sqrt  [DFLOAT.TAV]
square root
if argument has no precision,
argument must not be negative