Number |
List |
String |
Dict |
Action |
Command |
|
---|---|---|---|---|---|---|
Example |
42 |
[a, b, c] |
"abc" |
{a: b, c: d} |
(cmd arg1 arg2) |
[args, act1, act2] |
a+b |
2+3 → 5 |
[a,b] + [c,d] → [a,b,c,d] |
"ab"+"cd" →"abcd" |
{a: b} + {c: d} → {a: b, c: d} |
A1+A2 → do A1 A2 |
[a1, A1, A2] + [a2, A3, A4] → [a0, [apply, c1, a0], [apply, c2, a0]] |
a-b |
2-3 → -1 |
[a,b]-[a,d] → [b] |
"abcabc"-"ab" → "cabc" ?→ "cc" |
{a:b, c:d} - {a:b, c:e} → {c:d} |
A1 - A2 // A1 == A2 → () (c1 a b) - A2 → (c1-A2, a, b) |
c1 - c2 // c1 == c2 → skip [a, A1, A2] - c2 → [a, A1-c2, A2-c2] |
a*b |
2*3 → 6 |
[a,b]*2 → [a,b,a,b] |
"abc"*2 →"abcabc" |
{a:b}*2 → !error |
A1*2 → do A1 A1 |
C1*2 → [a0, (apply C1 a0), (apply C1 a0)] |
a/b |
2/3 → 0.66... |
[a, b]/2 → [[a],[b]] |
"abc"/2 → ["ab", "c"] |
{a:b,c:d}/2 → !error |
(c a b) / 2 → !error ?→ (do (c a) (c b)) |
C1/2 → !error |
a[b] |
→ !error |
L[N] → x → null L[~N] → !error |
S[N] → c → "" S[~N] → !error |
{a:b}[a] → b {a:b}[c] → null |
(c a b)[0] → c (c a b)[2] → b (c a b)[3] → null A[S] → A[A[0][0].indexOf(S)] A[~S|~N] → !error |
[args, A1, A2][0] → args [args, A1, A2][2] → A2 C[~N] → !error ? C[S] → As |
a.indexOf(b) |
→ !error |
L.indexOf(a) → N → -1 |
S.indexOf(s1) → N → -1 S.indexOf(~S) → !error |
{a:b}.indexOf(b) → a {a:b}.indexOf(c) → undefined ?→ null |
A.indexOf(x) → N → -1 |
C.indexOf(A) → N → -1 C.indexOf(S) → N → -1 C.indexOf(~A|~S) → !error |
a[b:c] |
→ !error |
[a,b,c,d][1:2] → [b,c] |
"abcd"[1:2] → "bc" |
→ !error |
(c a b d e f)[1:2] → [a, b] |
[args, A1, A2, A3][1:2] → [A1, A2] |
a.split(b) |
→ !error |
[a,b,c].split(b) → [[a],[c]] |
S.split(S|N|null) → [...] S.split(~S|~N|~null) → !error |
D.split(...) → !error |
(c a b).split(a) → (do (c a) (c b)) |
[args, A1, A2].split(A1) → [[args A1], [args A2]] C.split(~A|~N) → !error |
a.join(b) ?.join(~S|~N|null) → !error |
→ !error |
L.join() → L.join(",") [a,b,c].join("s") → "asbsc" |
"abc".join("s") → "asbsc" |
D.join() → D.join(",") D.join(s1) → D.join(s1, ":") {a:b,c:d}.join(s1, s2) → ""+a+s1+b+s2+c+s1+d |
A.join() → A.join(" ") A.join(s) → A.map(toString).join(s) |
C.join() → C.join("\n* ") C.join(s) → C.map(toString).join(s) |
a.replace(b, c) |
→ !error |
[a,b,c].replace(a, d) → [d,b,c] |
"abc".replace("a", "d") → "dbc" S.replace(~S) → !error |
{a:b,c:d}.replace(a, d) → {a:d, c:d} |
(c a b).replace(a, d) → (c d b) |
[args, A1, A2].replace(A1, A3) → [args, A3, A2] C.replace(~A) → !error |
a.match(b) |
→ !error |
L.match(C) → L.filter(C).length > 0 L.match(~C) → true → false |
S.match(C) → (C S) → true → false → !error S.match(s) → S.indexOf(s) > -1 S.match(~S|~N|~C) → !error |
D.match(C) → D.filter(C).length > 0 {a:b,c:d}.match(a) → false {a:b,c:d}.match(b) → true |
||
a.filter(b) |
→ !error |
L.filter(C) → L' // where (C li) L.filter(D) → L' // where D[li] L.filter(x) → [] → [x,x,...] |
S.filter(C) → (C S) → S' S.filter(s) → "" → s + s + ... |
D.filter(C) → D' // where (C k v) D.filter(x) → {} → {x:y} |
(c a b).filter(C) → ??? |
|
a.map(b) |
→ !error |
L.map(C) → L' L.map(D) → L' L.map(L2) → [L2[a], L2[b],...] L.map(s) → [s,s,...] |
S.map(C) → S' |
D.map(C) → D' |
||