base:https://codeberg.org/ngn/k
main:https://codeberg.org/growler/k
make:all:;clang -w -Os -ok ?.c&&./k
https://liberapay.com/arlyle/donate
 1ArLyWLWrhqfVfVmw4j7bXQKHFobGSUozS
file: a.h common header
      g.h generated by g.k
 2221 0.c main
  799 1.c arithmetic monadic verbs
 7289 2.c arithmetic dyadic  verbs
 5255 3.c arithmetic adverbs
  860 4.c prime sieve
 6205 a.c eval, apply, amend: . @
 4758 b.c bytecode compiler and vm
 2900 c.c type conversions
  762 e.c error handling
 2983 f.c find
 4209 h.c shapes: x#y ,x x,y
 2292 i.c input/output
 1949 j.c json: `j@x `j?x
 5733 m.c memory manager and repl
 3367 o.c order and equivalence
 3460 p.c parser
 2371 r.c random
 4247 s.c to string: $x `k@x
  998 test.c unit test t.k
 2489 v.c other verbs
 7356 w.c other adverbs

type: A:object unsigned(UC:0 UH:1 U:2 W:3) signed(G:0 H:1 I:2 L:3) C:char S:C* F:double
func: A1 A2 A3 A4 A5 A6 A7 A8: A*f(A x,A y,A z,...) define new monad dyad triad tetrad pentad hexad heptad ogdoad

xR yR zR uR:increment reference of xyzu
mr         :decrement or clear reference of x
mrn        :decrement or clear reference of x:a generic-list

_1(f,x)         monadic apply f x
_2(f,x,y)       dyadic apply x f y
_8(f,args,n)    general apply f[args...] with n arguments
e.g. A f=evs("repl.fmt",0);A x=evs("1+2",0);A result=_1(f,x);out(result);
x1 y1 z1 u1 (f) monadic apply f x/y/z/u

e1f             monadic apply f x penetrate?
e2f             dyadic? apply x f y penetrate?
o1f             ?

F  for i in range(a) 
Fj for j in range(a)

xyzu t AEBGHILFCSMmilfcsopqruvwx
xtA ytA ztA utA:is xyzu generic-list   ()
xtE ytE ztE utE:is xyzu enumeration    !i
xtB ytB ztB utB:is xyzu int1-list      ,1
xtG ytG ztG utG:is xyzu int8-list      ,i
xtH ytH ztH utH:is xyzu int16-list     ,i
xtI ytI ztI utI:is xyzu int32-list     ,i
xtL ytL ztL utL:is xyzu int64-list     ,i
xtF ytF ztF utF:is xyzu float list     ,f
xtC ytC ztC utC:is xyzu char-list      ""
xtS ytS ztS utS:is xyzu symbol-list    ,`
xtM ytM ztM utM:is xyzu table          +m
xtm ytm ztm utm:is xyzu dictionary     X!Y
xti yti zti uti:is xyzu int32-atom     5
xtl ytl ztl utl:is xyzu int64-atom     6
xtf ytf ztf utf:is xyzu float64-atom   .6
xtc ytc ztc utc:is xyzu char-atom      "c"
xts yts zts uts:is xyzu symbol-atom    `
xto yto zto uto:is xyzu lambda         {}
xtp ytp ztp utp:is xyzu projection     1+
xtq ytq ztq utq:is xyzu train          ++
xtr ytr ztr utr:is xyzu partial-adverb +/
xtu ytu ztu utu:is xyzu monad          +:
xtv ytv ztv utv:is xyzu dyad           +
xtw ytw ztw utw:is xyzu adverb         /
xtx ytx ztx utx:is xyzu external       2:

xyzu a aghilfc
xa ya za ua:ith element of xyzu accessed as generic
xg yg zg ug:ith element of xyzu accessed as int8
xh yh zh uh:ith element of xyzu accessed as int16
xi yi zi ui:ith element of xyzu accessed as int32
xl yl zl ul:ith element of xyzu accessed as int64
xf yf zf uf:ith element of xyzu accessed as float64
xc yc zc uc:ith element of xyzu accessed as char

xA yA zA uA:generic pointer to data of xyzu
xG yG zG uG:int8 pointer to data of xyzu
xH yH zH uH:int16 pointer to data of xyzu
xI yI zI uI:int32 pointer to data of xyzu
xL yL zL uL:int64 pointer to data of xyzu
xF yF zF uF:float64 pointer to data of xyzu
xC yC zC uC:char pointer to data of xyzu

xb yb zb ub:bucket index of xyzu
xE yE zE uE:adverb for tr of xyzu
xK yK zK uK:returns 1:monad/adverb 2:verb k:lambda/projection/train/applied-adverb
xk yk zk uk:arity(argument count) of xyzu
xN yN zN uN:element count of xyzu
xn yn zn un:length of xyzu
xo yo zo uo:scroffset(for symbols) of xyzu
xR yR zR uR:increment reference count of xyzu
xr yr zr ur:reference count of xyzu
xt yt zt ut:type(tA tE tB tG tH tI tL tF tC tS tM tm ti tl tf tc ts to tp tq tr tu tv tw tx tn) of xyzu
xT yT zT uT:type-byte in header of xyzu
xV yV zV uV:pointer to data of xyzu
xv yv zv uv:int32 value of xyzu
xw yw zw uw:size of xyzu 2^(0:1bit 3:8bit 4:16bit 5:32bit 6:64bit)
xX yX zX uX:pointer to next chunk in bucket
xx yx zx ux:first argument/element of xyzu accessed as generic
xy yy zy uy:second argument/element of xyzu accessed as generic
xz yz zz uz:third argument/element of xyzu accessed as generic

an             :create new t:type list with n:count elements
ac ai al as    :create new atom from v:int64
ax(p,k)        :verb from p:function-pointer and k:argument-count
aV(t,n,p)      :create new list from t:type n:length p:raw-data-pointer
aA0 aA1 aA2 aA3:create new n argument function that returns a
aA             :create new generic-list from n:length
aB             :create new int1-list from n:length
aG             :create new int8-list from n:length
aH             :create new int16 list from n:length
aI             :create new int32-list from n:length
aL             :create new int64-list from n:length
aF             :create new float64-list from n:length
aC             :create new char-list from n:length
aS             :create new symbol-list from n:length
aCn            :create new char-list from native c string s:char-pointer n:length
aCm            :create new char-list from native c string p:char-pointer q:end-pointer
aCz            :create new char-list from native c string s:char-pointer til "\0"
az             :create new int64-atom or int32-atom depending on fit from n:value
af             :create new float64-atom from c float v:value
ar             :create new partial-adverb from v:? w:adverb?
aE             :create new enumeration from i:start j:end

au:some-monad (also for true?)
av:some-dyad
aw:some-adverb

X():switch on the type of x:left argument
Y():switch on the type of y:right argument
R R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13:return the last arg in cases of x:args except the last
R_:return the arg in default case 
RmMA     :return arg in case switch is dict/table/generic-list
RA       :return arg in case switch is generic-list
RE       :return arg in case switch is enumeration
RB       :return arg in case switch is bit-list
RG       :return arg in case switch is int8-list
RH       :return arg in case switch is int16-list
RI       :return arg in case switch is int32-list
RL       :return arg in case switch is int64-list
RF       :return arg in case switch is float64-list
RC       :return arg in case switch is char-list
RS       :return arg in case switch is symbol-list
RM       :return arg in case switch is table
Rm       :return arg in case switch is dict
Ri       :return arg in case switch is int32-atom
Rl       :return arg in case switch is int64-atom
Rf       :return arg in case switch is float64-atom
Rc       :return arg in case switch is char-atom
Rs       :return arg in case switch is symbol-atom
Ro       :return arg in case switch is lambda
Rp       :return arg in case switch is projection
Rq       :return arg in case switch is train
Rr       :return arg in case switch is partial-adverb
Ru       :return arg in case switch is monadic-verb
Rv       :return arg in case switch is dyadic-verb
Rw       :return arg in case switch is adverb
Rx       :return arg in case switch is external-func
RBGHILF  :return arg in case switch is some kind of numeric list except enumeration type
RcC      :return arg in case switch is char or char-list
REGHIL   :return arg in case switch is enumeration
RBGHIL   :return arg in case switch is a-list of bits/int8/int16/int32/int64
REBGHIL  :return arg in case switch is enumeration or list of bits/int8/int16/int32/int64
REBGHILC :return arg in case switch is enumeration or list of bits/int8/int16/int32/int64 or chars
REGHILC  :return arg in case switch is enumeration or list of int8/int16/int32/int64 or chars
REGHILF  :return arg in case switch is enumeration or list of int8/int16/int32/int64 or floats
RfF      :return arg in case switch is float64-atom or float64-list
RGC      :return arg in case switch is list of int8/chars
RGHIL    :return arg in case switch is list of int8/int16/int32/int64
RGHILC   :return arg in case switch is list of int8/int16/int32/int64/char
RGHILF   :return arg in case switch is list of int8/int16/int32/int64/float
Ric      :return arg in case switch is int32-atom or char-atom
RiI      :return arg in case switch is int32 or int32-list
Ril      :return arg in case switch is int32 or int64
Rilc     :return arg in case switch is int32-atom or int64-atom or char-atom
RilEBGHIL:return arg in case switch is int32-atom or int64-atom or enumeration or a list of bits/int8/int16/int32/int64
RilEGHIL :return arg in case switch is int32-atom or int64-atom or enumeration or a list of int8/int16/int32/int64
Rilf     :return arg in case switch is int32-atom or int64-atom or float64-atom
RlL      :return arg in case switch is int64-atom or int64-list
RmM      :return arg in case switch is dict or table
RmMA     :return arg in case switch is dict/table/generic-list
RMT      :return arg in case switch is table or some-list
Ropq     :return arg in case switch is lambda/projection/train
Ropqr    :return arg in case switch is lambda/projection/train/partial-adverb
RsS      :return arg in case switch is symbol-atom or symbol-list
Rt       :return arg in case switch is some-atom
RT       :return arg in case switch is some-list
RU       :return arg in case switch is some-func
Ruvw     :return arg in case switch is monad/dyad/adverb
RMT_C    :return arg in case switch is table or some-list except char-list
RMT_E    :return arg in case switch is table or some-list except enumeration
RT_A     :return arg in case switch is some-list except generic-list
RT_AE    :return arg in case switch is some-list except generic-list/enumeration
RT_E     :return arg in case switch is some-list except enumeration

XA    YA    ZA   :return the arg if xyz is generic-list
XG    YG    ZG   :return the arg if xyz is int8-list
XH    YH    ZH   :return the arg if xyz is int16-list
XI    YI    ZI   :return the arg if xyz is int-list
XL    YL    ZL   :return the arg if xyz is int64-list
XF    YF    ZF   :return the arg if xyz is float64-list
XC    YC    ZC   :return the arg if xyz is char-list
XB    YB    ZB   :return the arg if xyz is bit-list
XE    YE    ZE   :return the arg if xyz is enumeration
XS    YS    ZS   :return the arg if xyz is symbol-list
XM    YM    ZM   :return the arg if xyz is table
Xm    Ym    Zm   :return the arg if xyz is dict
Xi    Yi    Zi   :return the arg if xyz is int32-atom
Xl    Yl    Zl   :return the arg if xyz is int64-atom
Xf    Yf    Zf   :return the arg if xyz is float64-atom
Xs    Ys    Zs   :return the arg if xyz is symbol-atom
Xc    Yc    Zc   :return the arg if xyz is char-atom
Xo    Yo    Zo   :return the arg if xyz is lambda
Xp    Yp    Zp   :return the arg if xyz is projection
Xq    Yq    Zq   :return the arg if xyz is train
Xr    Yr    Zr   :return the arg if xyz is partial-adverb
Xu    Yu    Zu   :return the arg if xyz is monad
Xv    Yv    Zv   :return the arg if xyz is dyad
Xw    Yw    Zw   :return the arg if xyz is adverb
Xx    Yx    Zx   :return the arg if xyz is external-func
XU    YU    ZU   :return the arg if xyz is function
XP    YP    ZP   :return the arg if xyz is packed
XR    YR    ZR   :return the arg if xyz has referenced
Xt    Yt    Zt   :return the arg if xyz is some-atom
XT    YT    ZT   :return the arg if xyz is some-list
Xz    Yz    Zz   :return the arg if xyz is int32-atom or int64-atom
XZ    YZ    ZZ   :return the arg if xyz is int32-list or int64-list
XcC   YcC   ZcC  :return the arg if xyz is char-atom or char-list
XlL   YlL   ZlL  :return the arg if xyz is int64-atom or int64-list
XfF   YfF   ZfF  :return the arg if xyz is float64-atom or float64-list
XsS   YsS   ZsS  :return the arg if xyz is symbol-atom or symbol-list
XzZ   YzZ   ZzZ  :return the arg if xyz is integer-atom or integer-list
XmM   YmM   ZmM  :return the arg if xyz is dict or table
Xmt   Ymt   Zmt  :return the arg if xyz is dict or some-atom
XMT   YMT   ZMT  :return the arg if xyz is table or some-list
Xzf   Yzf   Zzf  :return the arg if xyz is integer-atom or float64-atom
Xzfs  Yzfs  Zzfs :return the arg if xyz is integer-atom or float64-atom or symbol-atom
Xzfsc Yzfsc Zzfsc:return the arg if xyz is integer-atom or float64-atom or symbol-atom or char-atom
XZF   YZF   ZZF  :return the arg if xyz is integer-list or float64-list
XZFS  YZFS  ZZFS :return the arg if xyz is integer-list or float64-list or symbol-list
XZFSC YZFSC ZZFSC:return the arg if xyz is integer-list or float64-list or symbol-list or char-list
Xzc   Yzc   Zzc  :return the arg if xyz is integer-atom or char-atom
XZC   YZC   ZZC  :return the arg if xyz is integer-list or char-list
Xzfc  Yzfc  Zzfc :return the arg if xyz is integer-atom or float64-atom or char-atom
XZFC  YZFC  ZZFC :return the arg if xyz is integer-list or float64-list or char-list
XmMA  YmMA  ZmMA :return the arg if xyz is dict or table or generic-list
XsSA  YsSA  ZsSA :return the arg if xyz is symbol-atom or symbol-list or generic-list
XSA   YSA   ZSA  :return the arg if xyz is symbol-list or generic-list