@calcit/procs 0.5.6 → 0.5.10
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 +13 -13
- package/docs/symbol-spec.md +15 -0
- package/lib/calcit.procs.js +7 -1
- package/package.json +1 -1
- package/ts-src/calcit.procs.ts +9 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
### Calcit Scripting Language
|
|
2
2
|
|
|
3
|
-
> Lisp compiling to JavaScript ES Modules. (Similar to ClojureScript, but in very different syntax.)
|
|
3
|
+
> Lisp compiling to JavaScript ES Modules. Runs in Rust(Similar to ClojureScript, but in very different syntax.).
|
|
4
4
|
|
|
5
5
|
- Home http://calcit-lang.org/
|
|
6
6
|
- API Doc(heavily influenced by ClojureScript) http://apis.calcit-lang.org/
|
|
@@ -27,17 +27,7 @@ For Ubuntu 20.04, try binaries from http://bin.calcit-lang.org/linux/ , which ar
|
|
|
27
27
|
|
|
28
28
|
### Usage
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
cr compact.cirru --1 # run only once
|
|
34
|
-
|
|
35
|
-
cr compact.cirru # watch mode enabled by default
|
|
36
|
-
|
|
37
|
-
cr compact.cirru --init-fn='app.main/main!' # specifying init-fn
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Inline evaling:
|
|
30
|
+
Snippets evaling:
|
|
41
31
|
|
|
42
32
|
```bash
|
|
43
33
|
cr -e 'range 100'
|
|
@@ -56,6 +46,16 @@ println "|a demo"
|
|
|
56
46
|
'
|
|
57
47
|
```
|
|
58
48
|
|
|
49
|
+
Run with a [compact.cirru](https://github.com/calcit-lang/lilac/blob/master/compact.cirru):
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cr compact.cirru --1 # run only once
|
|
53
|
+
|
|
54
|
+
cr compact.cirru # watch mode enabled by default
|
|
55
|
+
|
|
56
|
+
cr compact.cirru --init-fn='app.main/main!' # specifying init-fn
|
|
57
|
+
```
|
|
58
|
+
|
|
59
59
|
Emitting code:
|
|
60
60
|
|
|
61
61
|
```bash
|
|
@@ -68,7 +68,7 @@ cr compact.cirru --emit-ir # compiles intermediate representation into program-i
|
|
|
68
68
|
### Calcit Editor & Bundler
|
|
69
69
|
|
|
70
70
|
Install [Calcit Editor](https://github.com/calcit-lang/editor) and run `ct` to launch editor server,
|
|
71
|
-
which writes `compact.cirru` and `.compact-inc.cirru` on saving. Try launching example by
|
|
71
|
+
which writes `compact.cirru` and `.compact-inc.cirru` on saving. Try launching example by cloning [Calcit Workflow](https://github.com/calcit-lang/calcit-workflow).
|
|
72
72
|
|
|
73
73
|
Read more in [Minimal Calcit](https://github.com/calcit-lang/minimal-calcit/blob/main/README.md) to learn how to code Calcit with a plain text editor.
|
|
74
74
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
> some notes about evaluating symbols
|
|
2
|
+
|
|
3
|
+
There several kinds of symbols:
|
|
4
|
+
|
|
5
|
+
- raw syntax symbols, `&` `?` `~` `~@`...
|
|
6
|
+
- data symbol, probably created via `turn-symbol`
|
|
7
|
+
- local variables
|
|
8
|
+
- local definitions
|
|
9
|
+
- imported variables
|
|
10
|
+
- namespaced imported symbols
|
|
11
|
+
- imported default variables
|
|
12
|
+
- imported host variables
|
|
13
|
+
|
|
14
|
+
Currently they are share the structure `Calcit::Symbol{..}`, which is buggy
|
|
15
|
+
and requires refactor in future.
|
package/lib/calcit.procs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
// CALCIT VERSION
|
|
3
|
-
export const calcit_version = "0.5.
|
|
3
|
+
export const calcit_version = "0.5.10";
|
|
4
4
|
import "@calcit/ternary-tree";
|
|
5
5
|
import { parse } from "@cirru/parser.ts";
|
|
6
6
|
import { writeCirruCode } from "@cirru/writer.ts";
|
|
@@ -1363,6 +1363,12 @@ export let _$n_list_$o_distinct = (xs) => {
|
|
|
1363
1363
|
}
|
|
1364
1364
|
return new CalcitSliceList(result);
|
|
1365
1365
|
};
|
|
1366
|
+
export let _$n_str_$o_pad_left = (s, size, pattern) => {
|
|
1367
|
+
return s.padStart(size, pattern);
|
|
1368
|
+
};
|
|
1369
|
+
export let _$n_str_$o_pad_right = (s, size, pattern) => {
|
|
1370
|
+
return s.padEnd(size, pattern);
|
|
1371
|
+
};
|
|
1366
1372
|
export let _$n_get_os = () => {
|
|
1367
1373
|
return kwd("js-engine");
|
|
1368
1374
|
};
|
package/package.json
CHANGED
package/ts-src/calcit.procs.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// CALCIT VERSION
|
|
2
|
-
export const calcit_version = "0.5.
|
|
2
|
+
export const calcit_version = "0.5.10";
|
|
3
3
|
|
|
4
4
|
import { overwriteComparator, initTernaryTreeMap } from "@calcit/ternary-tree";
|
|
5
5
|
import { parse, ICirruNode } from "@cirru/parser.ts";
|
|
@@ -1423,6 +1423,14 @@ export let _$n_list_$o_distinct = (xs: CalcitList): CalcitSliceList => {
|
|
|
1423
1423
|
return new CalcitSliceList(result);
|
|
1424
1424
|
};
|
|
1425
1425
|
|
|
1426
|
+
export let _$n_str_$o_pad_left = (s: string, size: number, pattern: string): string => {
|
|
1427
|
+
return s.padStart(size, pattern);
|
|
1428
|
+
};
|
|
1429
|
+
|
|
1430
|
+
export let _$n_str_$o_pad_right = (s: string, size: number, pattern: string): string => {
|
|
1431
|
+
return s.padEnd(size, pattern);
|
|
1432
|
+
};
|
|
1433
|
+
|
|
1426
1434
|
export let _$n_get_os = (): CalcitKeyword => {
|
|
1427
1435
|
return kwd("js-engine");
|
|
1428
1436
|
};
|