Skip to content

Commit 9d95852

Browse files
docs(lispy): update readme
1 parent c010478 commit 9d95852

File tree

2 files changed

+76
-3
lines changed

2 files changed

+76
-3
lines changed

packages/lispy/README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- [Status](#status)
1919
- [Installation](#installation)
2020
- [Dependencies](#dependencies)
21+
- [Usage examples](#usage-examples)
2122
- [API](#api)
2223
- [Authors](#authors)
2324
- [License](#license)
@@ -34,14 +35,27 @@ The core language is intentionally kept extremely minimal and currently only
3435
contains the following:
3536

3637
- basic math ops (multi-arity)
38+
- logic operators (multi-arity)
39+
- `and`
40+
- `or`
41+
- `not`
42+
- bitwise operators
43+
- `<<`
44+
- `>>` / `>>>`
45+
- `bit-and`
46+
- `bit-or`
47+
- `bit-xor`
48+
- `bit-not`
3749
- comparison operators
3850
- constants & functions from JS-native `Math`
3951
- selected utilities from [thi.ng/math](https://thi.ng/math) package
4052
- `HALF_PI`
4153
- `TAU`
4254
- `clamp`: clamp value to interval
55+
- `deg`: convert radians to degrees
4356
- `fit`: fit value from one interval into another
4457
- `mix`: linear interpolation (same as GLSL `mix()`)
58+
- `rad`: convert degrees to radians
4559
- `step`: same as GLSL `step()`
4660
- `smoothstep`: same as GLSL `smoothstep()`
4761
- basic FP programming constructs
@@ -51,6 +65,8 @@ contains the following:
5165
- `let`: locally scope var bindings/expression
5266
- `partial`: partial application (currying)
5367
- basic list/array processing
68+
- `aget`: get array index
69+
- `aset`: set array index
5470
- `count`: number of items
5571
- `concat`: same as `Array.prototype.concat(...)`
5672
- `filter`: list/array filtering
@@ -98,7 +114,7 @@ For Node.js REPL:
98114
const lispy = await import("@thi.ng/lispy");
99115
```
100116

101-
Package sizes (brotli'd, pre-treeshake): ESM: 1.30 KB
117+
Package sizes (brotli'd, pre-treeshake): ESM: 1.40 KB
102118

103119
## Dependencies
104120

@@ -111,6 +127,16 @@ Package sizes (brotli'd, pre-treeshake): ESM: 1.30 KB
111127

112128
Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
113129

130+
## Usage examples
131+
132+
One project in this repo's
133+
[/examples](https://github.com/thi-ng/umbrella/tree/develop/examples)
134+
directory is using this package:
135+
136+
| Screenshot | Description | Live demo | Source |
137+
|:------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------|:-------------------------------------------------|:------------------------------------------------------------------------------|
138+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/lispy-repl.png" width="240"/> | Browser REPL for a Lispy S-expression based mini language | [Demo](https://demo.thi.ng/umbrella/lispy-repl/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/lispy-repl) |
139+
114140
## API
115141

116142
[Generated API docs](https://docs.thi.ng/umbrella/lispy/)
@@ -160,6 +186,16 @@ evalExpressions(SRC, {...ENV, name: "lispy"});
160186
// "<=": "<function>",
161187
// ">=": "<function>",
162188
// ">": "<function>",
189+
// "and": "<function>",
190+
// "or": "<function>",
191+
// "not": "<function>",
192+
// "<<": "<function>",
193+
// ">>": "<function>",
194+
// ">>>": "<function>",
195+
// "bit-and": "<function>",
196+
// "bit-or": "<function>",
197+
// "bit-xor": "<function>",
198+
// "bit-not": "<function>",
163199
// "E": 2.718281828459045,
164200
// "LN10": 2.302585092994046,
165201
// "LN2": 0.6931471805599453,
@@ -203,11 +239,17 @@ evalExpressions(SRC, {...ENV, name: "lispy"});
203239
// "tan": "<function>",
204240
// "tanh": "<function>",
205241
// "trunc": "<function>",
242+
// "HALF_PI": 1.5707963267948966,
243+
// "TAU": 6.283185307179586,
206244
// "clamp": "<function>",
245+
// "deg": "<function>",
207246
// "fit": "<function>",
208247
// "mix": "<function>",
248+
// "rad": "<function>",
209249
// "step": "<function>",
210-
// "smoothStep": "<function>",
250+
// "smoothstep": "<function>",
251+
// "aget": "<function>",
252+
// "aset": "<function>",
211253
// "push": "<function>",
212254
// "concat": "<function>",
213255
// "count": "<function>",

packages/lispy/tpl.readme.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,27 @@ The core language is intentionally kept extremely minimal and currently only
1414
contains the following:
1515

1616
- basic math ops (multi-arity)
17+
- logic operators (multi-arity)
18+
- `and`
19+
- `or`
20+
- `not`
21+
- bitwise operators
22+
- `<<`
23+
- `>>` / `>>>`
24+
- `bit-and`
25+
- `bit-or`
26+
- `bit-xor`
27+
- `bit-not`
1728
- comparison operators
1829
- constants & functions from JS-native `Math`
1930
- selected utilities from [thi.ng/math](https://thi.ng/math) package
2031
- `HALF_PI`
2132
- `TAU`
2233
- `clamp`: clamp value to interval
34+
- `deg`: convert radians to degrees
2335
- `fit`: fit value from one interval into another
2436
- `mix`: linear interpolation (same as GLSL `mix()`)
37+
- `rad`: convert degrees to radians
2538
- `step`: same as GLSL `step()`
2639
- `smoothstep`: same as GLSL `smoothstep()`
2740
- basic FP programming constructs
@@ -31,6 +44,8 @@ contains the following:
3144
- `let`: locally scope var bindings/expression
3245
- `partial`: partial application (currying)
3346
- basic list/array processing
47+
- `aget`: get array index
48+
- `aset`: set array index
3449
- `count`: number of items
3550
- `concat`: same as `Array.prototype.concat(...)`
3651
- `filter`: list/array filtering
@@ -115,6 +130,16 @@ evalExpressions(SRC, {...ENV, name: "lispy"});
115130
// "<=": "<function>",
116131
// ">=": "<function>",
117132
// ">": "<function>",
133+
// "and": "<function>",
134+
// "or": "<function>",
135+
// "not": "<function>",
136+
// "<<": "<function>",
137+
// ">>": "<function>",
138+
// ">>>": "<function>",
139+
// "bit-and": "<function>",
140+
// "bit-or": "<function>",
141+
// "bit-xor": "<function>",
142+
// "bit-not": "<function>",
118143
// "E": 2.718281828459045,
119144
// "LN10": 2.302585092994046,
120145
// "LN2": 0.6931471805599453,
@@ -158,11 +183,17 @@ evalExpressions(SRC, {...ENV, name: "lispy"});
158183
// "tan": "<function>",
159184
// "tanh": "<function>",
160185
// "trunc": "<function>",
186+
// "HALF_PI": 1.5707963267948966,
187+
// "TAU": 6.283185307179586,
161188
// "clamp": "<function>",
189+
// "deg": "<function>",
162190
// "fit": "<function>",
163191
// "mix": "<function>",
192+
// "rad": "<function>",
164193
// "step": "<function>",
165-
// "smoothStep": "<function>",
194+
// "smoothstep": "<function>",
195+
// "aget": "<function>",
196+
// "aset": "<function>",
166197
// "push": "<function>",
167198
// "concat": "<function>",
168199
// "count": "<function>",

0 commit comments

Comments
 (0)