Compare commits
No commits in common. "d37e51b6059699a0accdc8e491bd80f363655142" and "4f84f408a760dd9be854ab68692773688bfb7d3f" have entirely different histories.
d37e51b605
...
4f84f408a7
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.15",
|
||||
"version": "0.1.14",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.15",
|
||||
"version": "0.1.14",
|
||||
"license": "GPL-3.0",
|
||||
"devDependencies": {
|
||||
"shadow-cljs": "^2.26.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@ludus/ludus-js-pure",
|
||||
"version": "0.1.15",
|
||||
"version": "0.1.14",
|
||||
"description": "A Ludus interpreter in a pure JS function.",
|
||||
"type": "module",
|
||||
"main": "build/ludus.mjs",
|
||||
|
|
10
prelude.ld
10
prelude.ld
|
@ -435,7 +435,7 @@ fn add {
|
|||
() -> 0
|
||||
(x as :number) -> x
|
||||
(x as :number, y as :number) -> base :add (x, y)
|
||||
(x, y, ...zs) -> fold (add, zs, base :add (x, y))
|
||||
(x, y, ...zs) -> fold (base :add, zs, base :add (x, y))
|
||||
& add vectors
|
||||
((x1, y1), (x2, y2)) -> (add (x1, x2), add (y1, y2))
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ fn sub {
|
|||
() -> 0
|
||||
(x as :number) -> x
|
||||
(x as :number, y as :number) -> base :sub (x, y)
|
||||
(x, y, ...zs) -> fold (sub, zs, base :sub (x, y))
|
||||
(x, y, ...zs) -> fold (base :sub, zs, base :sub (x, y))
|
||||
((x1, y1), (x2, y2)) -> (base :sub (x1, x2), base :sub (y1, y2))
|
||||
}
|
||||
|
||||
|
@ -454,7 +454,7 @@ fn mult {
|
|||
() -> 1
|
||||
(x as :number) -> x
|
||||
(x as :number, y as :number) -> base :mult (x, y)
|
||||
(x, y, ...zs) -> fold (mult, zs, mult (x, y))
|
||||
(x, y, ...zs) -> fold (base :mult, zs, mult (x, y))
|
||||
(scalar as :number, (x, y)) -> (mult (x, scalar), mult (y, scalar))
|
||||
((x, y), scalar as :number) -> mult (scalar, (x, y))
|
||||
}
|
||||
|
@ -706,7 +706,7 @@ fn and {
|
|||
() -> true
|
||||
(x) -> bool (x)
|
||||
(x, y) -> base :and (x, y)
|
||||
(x, y, ...zs) -> fold (and, zs, base :and (x, y))
|
||||
(x, y, ...zs) -> fold (base :and, zs, base :and (x, y))
|
||||
}
|
||||
|
||||
fn or {
|
||||
|
@ -714,7 +714,7 @@ fn or {
|
|||
() -> true
|
||||
(x) -> bool (x)
|
||||
(x, y) -> base :or (x, y)
|
||||
(x, y, ...zs) -> fold (or, zs, base :or (x, y))
|
||||
(x, y, ...zs) -> fold (base :or, zs, base :or (x, y))
|
||||
}
|
||||
|
||||
&&& associative collections: dicts, structs, namespaces
|
||||
|
|
Loading…
Reference in New Issue
Block a user