@thi.ng/pointfree 3.1.59 → 3.1.61
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/CHANGELOG.md +1 -1
- package/README.md +1 -1
- package/array.d.ts +7 -5
- package/cond.d.ts +3 -3
- package/loop.d.ts +1 -1
- package/package.json +7 -7
- package/word.d.ts +5 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/array.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { StackContext, StackFn } from "./api.js";
|
|
2
2
|
/**
|
|
3
|
-
* Pushes a new empty array on the d-stack.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* Pushes a new empty array on the d-stack.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* While it's easily possible to use `[]` as part of a stack program, the `list`
|
|
7
|
+
* word is intended to be used as part of re-usuable {@link defWord} definitions
|
|
8
|
+
* to ensure a new array is being created for every single invocation of the
|
|
9
|
+
* word (else only a single instance is created due to the mutable nature of JS
|
|
8
10
|
* arrays).
|
|
9
11
|
*
|
|
10
12
|
* Compare:
|
package/cond.d.ts
CHANGED
|
@@ -15,9 +15,9 @@ import type { StackContext, StackProc } from "./api.js";
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const defCond: (_then: StackProc, _else?: StackProc) => (ctx: StackContext) => StackContext;
|
|
17
17
|
/**
|
|
18
|
-
* Non-HOF version of {@link
|
|
19
|
-
* d-stack. Executes `thenq` word/quotation if `test` is truthy, else
|
|
20
|
-
*
|
|
18
|
+
* Non-HOF version of {@link defCond}, expects `test` result and both branches
|
|
19
|
+
* on d-stack. Executes `thenq` word/quotation if `test` is truthy, else runs
|
|
20
|
+
* `elseq`.
|
|
21
21
|
*
|
|
22
22
|
* ( test thenq elseq -- ? )
|
|
23
23
|
*
|
package/loop.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ import type { StackContext, StackProc } from "./api.js";
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const defLoop: (test: StackProc, body: StackProc) => (ctx: StackContext) => StackContext;
|
|
20
20
|
/**
|
|
21
|
-
* Non-HOF version of {@link
|
|
21
|
+
* Non-HOF version of {@link defLoop}. Expects test result and body quotation /
|
|
22
22
|
* word on d-stack.
|
|
23
23
|
*
|
|
24
24
|
* ( testq bodyq -- ? )
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/pointfree",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.61",
|
|
4
4
|
"description": "Pointfree functional composition / Forth style stack execution engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.9.
|
|
39
|
-
"@thi.ng/checks": "^3.4.
|
|
40
|
-
"@thi.ng/compose": "^2.1.
|
|
41
|
-
"@thi.ng/equiv": "^2.1.
|
|
42
|
-
"@thi.ng/errors": "^2.4.
|
|
38
|
+
"@thi.ng/api": "^8.9.18",
|
|
39
|
+
"@thi.ng/checks": "^3.4.18",
|
|
40
|
+
"@thi.ng/compose": "^2.1.57",
|
|
41
|
+
"@thi.ng/equiv": "^2.1.42",
|
|
42
|
+
"@thi.ng/errors": "^2.4.11"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@microsoft/api-extractor": "^7.39.0",
|
|
@@ -132,5 +132,5 @@
|
|
|
132
132
|
"thi.ng": {
|
|
133
133
|
"year": 2015
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "7426e2ae6fca5482c6eaf649872296fc89955374\n"
|
|
136
136
|
}
|
package/word.d.ts
CHANGED
|
@@ -31,11 +31,12 @@ export declare const unwrap: ([stack]: StackContext, n?: number) => any;
|
|
|
31
31
|
*/
|
|
32
32
|
export declare const defWord: (prog: StackProgram, env?: StackEnv, mergeEnv?: boolean) => StackFn;
|
|
33
33
|
/**
|
|
34
|
-
* Like {@link
|
|
35
|
-
* to produced unwrapped value/tuple.
|
|
34
|
+
* Like {@link defWord}, but automatically calls {@link unwrap} on result
|
|
35
|
+
* context to produced unwrapped value/tuple.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* **Importatant:** Words defined with this function CANNOT be used as part of a
|
|
39
|
+
* larger stack program, only for standalone use.
|
|
39
40
|
*
|
|
40
41
|
* @param prog -
|
|
41
42
|
* @param n -
|