@plylang/plylang 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -81,6 +81,7 @@ The same permutations as in Factor follow, with names made of letters: `dupd`, `
|
|
|
81
81
|
: bi ( ..s a (a -- b) (a -- c) -- ..s b c )
|
|
82
82
|
: if ( ..s Bool (..s -- ..t) (..s -- ..t) -- ..t )
|
|
83
83
|
: quote ( ..s a -- ..s (-- a) )
|
|
84
|
+
: cons ( ..r a (..s a -- ..t) -- ..r (..s -- ..t) )
|
|
84
85
|
```
|
|
85
86
|
|
|
86
87
|
`call` takes a quotation and runs it on the rest. `dip` hides the value under the quotation, runs the quotation, and returns what it hid to the top. `dip2` and `dip3` hide two and three values. `keep` runs the quotation and returns the value it took. `keep2` returns two.
|
|
@@ -91,6 +92,8 @@ The same permutations as in Factor follow, with names made of letters: `dupd`, `
|
|
|
91
92
|
|
|
92
93
|
`quote` wraps the top. `42 quote` is a quotation of type `(-- Num)`.
|
|
93
94
|
|
|
95
|
+
`cons` pushes a value and then runs a quotation. The value sits under the quotation, so `5 [ 1 add ] cons` is a quotation of type `(-- Num)` that pushes five and then adds one. The call site does not name that value.
|
|
96
|
+
|
|
94
97
|
```ply
|
|
95
98
|
~ "Num" (eq, sub, mul)
|
|
96
99
|
|
|
@@ -374,7 +377,7 @@ A word named `main` whose scheme is `( -- Unit )` is the program of that module.
|
|
|
374
377
|
|
|
375
378
|
The exit code is 0 for success, 1 for a diagnostic, and 2 for bad arguments. `--help` prints the same lines. Messages are in English: `file:line:column: error: PLxxxx: message`, and the next line is a link to the matching section of `docs/Errors.md`.
|
|
376
379
|
|
|
377
|
-
What enters a word's function is its own prefix, from the bottom upward. One result is returned by itself. Several results come back as a JavaScript array: that is the calling convention, and it is not an `(Array a)` value. The words from `dup` through `over2` do not become calls. `call`, `dip`, `keep`, `bi`, `if`, and their neighbors inline the body of the quotation.
|
|
380
|
+
What enters a word's function is its own prefix, from the bottom upward. One result is returned by itself. Several results come back as a JavaScript array: that is the calling convention, and it is not an `(Array a)` value. The words from `dup` through `over2` do not become calls. `call`, `dip`, `keep`, `bi`, `if`, and their neighbors inline the body of the quotation. `cons` builds a quotation that pushes the value under it and then runs it.
|
|
378
381
|
|
|
379
382
|
## Building
|
|
380
383
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plylang/plylang",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Ply compiler and language server",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Algosail",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"bin/native.js"
|
|
34
34
|
],
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@plylang/plylang-darwin-arm64": "1.0.
|
|
37
|
-
"@plylang/plylang-darwin-x64": "1.0.
|
|
38
|
-
"@plylang/plylang-linux-arm64": "1.0.
|
|
39
|
-
"@plylang/plylang-linux-x64": "1.0.
|
|
40
|
-
"@plylang/plylang-win32-arm64": "1.0.
|
|
41
|
-
"@plylang/plylang-win32-x64": "1.0.
|
|
36
|
+
"@plylang/plylang-darwin-arm64": "1.0.6",
|
|
37
|
+
"@plylang/plylang-darwin-x64": "1.0.6",
|
|
38
|
+
"@plylang/plylang-linux-arm64": "1.0.6",
|
|
39
|
+
"@plylang/plylang-linux-x64": "1.0.6",
|
|
40
|
+
"@plylang/plylang-win32-arm64": "1.0.6",
|
|
41
|
+
"@plylang/plylang-win32-x64": "1.0.6"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "cargo build --release",
|