j stack language parse list operators
(comment) # length/non-list: -1
32-bit type system abc symbol (max 6) , cat
..000 list[quotation] 123 int (max 31 bit) []i@ index
....1 int x>>1 [..] list/quote [a]i v$store [a]"#v$ (append)
...10 symbol x>>2
..100 operator x>>3 numeric operators (dyadic) assign/quote/exec
heap memory +-*/% arith [p][a]: assign [p] to symbol a
0 total memory(log) <=> compare a lookup symbol a and exec
1 stack [p]. exec
2 stack(swap)
3 key/val list stack operators control
4..32 free list ~"_| swap dup pop roll c[t][e]? (if c then t else e)
33... data(buckets) ! print stack } pop/push to swap stack
unused '\^`; canvas draw [arg][func]& { pop/push from swap stack
w < j.w > j.wasm(2576 byte)
basic arithmetics is defined on integers
comparison
catenate, append, cons, enlist
set list index
enlist and cat
if
while
tail recursion: exec P. if true, exec T, else exec R recurse
each/map: apply f to each element of A
dyadic each
each right
each left
at/index
take/drop/reverse
amend multiple
over/fold, over initial
where
atomic extension, vectorize
| symbol | quotation |
|---|---|
| enlist | []~0~$ |
| cat | enlist, |
| ifte | }}.{{? |
| if | []? |
| iff | }.{[]? |
| while | }"}.{{"|}cat{cat[while],[]? |
| times | }"1-}{{"|}cat{cat[times],[]? |
| tailrc | }}"}.{{"|{"}|}cat{cat{cat[tailrc],? |
| ntil | []~["][1-"},{]while_ |
| til | }[]["#]{,[<],["#,]while |
| first | 0@ |
| last | "#1-@ |
| balt | "}#~"}#<{{|| |
| eachs | balt["|#~"|~@|}|~"}.~"#||${~{~eachs][|__]? |
| each | ~[]eachs |
| eachds | balt["}#~"}~"|@|~"}~@|~"}.{~{~{~{"#||$eachds][}___{]? |
| eachd | |[]eachds |
| eachrs | balt["}#~"}~@~"}~||"}.{~{~{~{~,eachrs][}___{]? |
| eachr | |[]eachrs |
| eachl | [~]~,|~[]eachrs |
| at | [@]eachr |
| take | til at |
| rev | "#ntil at |
| drop | ~"#ntil~|"#||-take rev at |
| amend | ~"#["1 drop}first ~"}${{~amend][__]? |
| overs | "#}~"}~{{<["}~"1+}@~"}.{{{overs][___]? |
| overi | ~0~overs |
| over | }"first~1drop{overi |
| where | []~0~ [~"}~[,][_]?{1+]overi_ |
| atomx | }"#0<2*}~"#0<}~{{+[[eachd][eachr][eachl][.]]~@{~. |
| add | [+]atomx |
| sub | [-]atomx |
| mul | [*]atomx |
| div | [/]atomx |
| lt | [<]atomx |
| gt | [>]atomx |
| eq | [=]atomx |
| neq | [=0=]atomx |
| not | 0eq |
| arc | [97 114 99]& |
| arcto | [97 114 99 84 111]& |
| bpath | [][98 101 103 105 110 80 97 116 104]& |
| bezito | [98 101 122 105 101 114 67 117 114 118 101 84 111]& |
| crect | [99 108 101 97 114 82 101 99 116]& |
| clip | [][99 108 105 112]& |
| cpath | [][99 108 111 115 101 80 97 116 104]& |
| lingrd | [99 114 101 97 116 101 76 105 110 101 97 114 71 114 97 100 105 101 110 116]& |
| radgrd | [99 114 101 97 116 101 82 97 100 105 97 108 71 114 97 100 105 101 110 116]& |
| ellips | [101 108 108 105 112 115 101]& |
| fill | [][102 105 108 108]& |
| frect | [102 105 108 108 82 101 99 116]& |
| fstyle | [102 105 108 108 83 116 121 108 101]& |
| ftext | [102 105 108 108 84 101 120 116]& |
| font | [102 111 110 116]& |
| lcap | [108 105 110 101 67 97 112]& |
| ldoff | [108 105 110 101 68 97 115 104 79 102 102 115 101 116]& |
| ljoin | [108 105 110 101 74 111 105 110]& |
| lineto | [108 105 110 101 84 111]& |
| lwidth | [108 105 110 101 87 105 100 116 104]& |
| moveto | [109 111 118 101 84 111]& |
| qcto | [113 117 97 100 114 97 116 105 99 67 117 114 118 101 84 111]& |
| rect | [114 101 99 116]& |
| rstra | [][114 101 115 101 116 84 114 97 110 115 102 111 114 109]& |
| rstore | [][114 101 115 116 111 114 101]& |
| rotate | [114 111 116 97 116 101]& |
| save | [][115 97 118 101]& |
| scale | [115 99 97 108 101]& |
| sldash | [115 101 116 76 105 110 101 68 97 115 104]& |
| setra | [115 101 116 84 114 97 110 115 102 111 114 109]& |
| shblur | [115 104 97 100 111 119 66 108 117 114]& |
| shcol | [115 104 97 100 111 119 67 111 108 111 114]& |
| shoffx | [115 104 97 100 111 119 79 102 102 115 101 116 88]& |
| shoffy | [115 104 97 100 111 119 79 102 102 115 101 116 89]& |
| stroke | [][115 116 114 111 107 101]& |
| srect | [115 116 114 111 107 101 82 101 99 116]& |
| sstyle | [115 116 114 111 107 101 83 116 121 108 101]& |
| stext | [115 116 114 111 107 101 84 101 120 116]& |
| talign | [116 101 120 116 65 108 105 103 110]& |
| tbline | [116 101 120 116 66 97 115 101 108 105 110 101]& |
| transf | [116 114 97 110 115 102 111 114 109]& |
| transl | [116 114 97 110 115 108 97 116 101]& |
ellipse roll koch sierpinski arrowhead tree square-spiral reuleux plant