@plylang/plylang 1.1.3 → 1.1.4

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.
Files changed (2) hide show
  1. package/README.md +12 -12
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -34,13 +34,13 @@ An omitted stack bottom is the same tail on the left and on the right. An explic
34
34
 
35
35
  Five built-in types and two constructors of arity 1 are visible in every module. They cannot be redefined.
36
36
 
37
- | Type | Literal | In JavaScript |
38
- | --- | --- | --- |
39
- | `Num` | `1`, `42`, `1.5`, `1e-3` | number |
40
- | `Int` | `0n`, `42n`, `-42n` | `bigint` |
41
- | `Str` | `"hi"`, `"a\nb"` | string |
42
- | `Bool` | `true`, `false` | boolean |
43
- | `Unit` | the word `Unit` | `undefined` |
37
+ | Type | Literal | In JavaScript |
38
+ | ------ | ------------------------ | ------------- |
39
+ | `Num` | `1`, `42`, `1.5`, `1e-3` | number |
40
+ | `Int` | `0n`, `42n`, `-42n` | `bigint` |
41
+ | `Str` | `"hi"`, `"a\nb"` | string |
42
+ | `Bool` | `true`, `false` | boolean |
43
+ | `Unit` | the word `Unit` | `undefined` |
44
44
 
45
45
  `(Array a)` is an array. `(StrMap a)` is a dictionary with a string key. Bare digits are `Num`, an ordinary number in JavaScript. `Int` is written with the suffix `n` and becomes a `bigint`. In the examples below a number is `Num`. `1.0` is a number. `1.` is the number `1` and a separate dot. A string accepts `\\`, `\"`, `\n`, `\t`, and `\r`.
46
46
 
@@ -96,13 +96,13 @@ The same permutations as in Factor follow, with names made of letters: `dupd`, `
96
96
  `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.
97
97
 
98
98
  ```ply
99
- ~ "@plylang/prelude/Classes/Eq" equal
100
- ~ "@plylang/prelude/Classes/Subtractable" subtract
99
+ ~ "@plylang/prelude/Classes/Setoid" equal
100
+ ~ "@plylang/prelude/Classes/Subtractable" sub
101
101
  ~ "@plylang/prelude/Classes/Arithmetic" multiply
102
102
  ~ "@plylang/prelude/Data/Num"
103
103
 
104
104
  : fact ( Num -- Num )
105
- dup 0 equal [ drop 1 ] [ dup 1 subtract fact multiply ] if
105
+ dup 0 equal [ drop 1 ] [ dup 1 sub fact multiply ] if
106
106
  ```
107
107
 
108
108
  Zero is replaced by one. Otherwise `n` and `n - 1` remain on the stack, the recursive `fact` computes the second, and `multiply` multiplies.
@@ -259,10 +259,10 @@ The order in the example is the dictionary, the key, and the value on top.
259
259
  ```
260
260
 
261
261
  ```ply
262
- ~ "@plylang/prelude/Classes/Eq" Eq, equal
262
+ ~ "@plylang/prelude/Classes/Setoid" Setoid, equal
263
263
  ~ "@plylang/prelude/Data/Num"
264
264
 
265
- : same ( Eq a => a a -- Bool )
265
+ : same ( Setoid a => a a -- Bool )
266
266
  equal
267
267
  ```
268
268
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plylang/plylang",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Ply compiler",
5
5
  "license": "MIT",
6
6
  "author": "Algosail",
@@ -30,12 +30,12 @@
30
30
  "bin/native.js"
31
31
  ],
32
32
  "optionalDependencies": {
33
- "@plylang/plylang-darwin-arm64": "1.1.3",
34
- "@plylang/plylang-darwin-x64": "1.1.3",
35
- "@plylang/plylang-linux-arm64": "1.1.3",
36
- "@plylang/plylang-linux-x64": "1.1.3",
37
- "@plylang/plylang-win32-arm64": "1.1.3",
38
- "@plylang/plylang-win32-x64": "1.1.3"
33
+ "@plylang/plylang-darwin-arm64": "1.1.4",
34
+ "@plylang/plylang-darwin-x64": "1.1.4",
35
+ "@plylang/plylang-linux-arm64": "1.1.4",
36
+ "@plylang/plylang-linux-x64": "1.1.4",
37
+ "@plylang/plylang-win32-arm64": "1.1.4",
38
+ "@plylang/plylang-win32-x64": "1.1.4"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "cargo build --release",