fez-lisp 1.1.53 → 1.1.54

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -244,7 +244,8 @@ console.log(fez(tree(`(+ (|> 1 (+ 2) (* 3) (- 1)) (- (* (+ 1 2) 3) 1))`)))
244
244
  ```lisp
245
245
  ; all keywords
246
246
  (/) (+) (*) (-) (=) (<) (>) (>=) (<=) (&) (~) (|) (^) (<<) (>>) (>>>)
247
- (|>) (mod) (let) (if) (unless) (not) (and) (or) (cond) (atom?) (lambda)
247
+ (mod) (let) (if) (not) (and) (or) (cond) (atom?) (lambda)
248
248
  (length) (do) (array) (set!) (get) (apply) (void)
249
249
  (log!) (log-string!) (log-char!) (clear!)
250
+ (|>) (list) (unless)
250
251
  ```
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "fez-lisp",
3
3
  "description": "Lisp interpreted & compiled to JavaScript",
4
4
  "author": "AT290690",
5
- "version": "1.1.53",
5
+ "version": "1.1.54",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
@@ -861,6 +861,17 @@ export const deSuggar = (ast) => {
861
861
  for (let i = 0; i < inp.length; ++i) exp[i] = inp[i]
862
862
  }
863
863
  break
864
+ case KEYWORDS.LIST_TYPE:
865
+ {
866
+ exp.length = 0
867
+ let temp = exp
868
+ for (const item of rest) {
869
+ temp.push([0, KEYWORDS.ARRAY_TYPE], item, [])
870
+ temp = temp.at(-1)
871
+ }
872
+ temp.push([0, 'array'])
873
+ }
874
+ break
864
875
  case KEYWORDS.UNLESS:
865
876
  {
866
877
  if (rest.length > 3 || rest.length < 2)
package/src/keywords.js CHANGED
@@ -9,6 +9,7 @@ export const PLACEHOLDER = '.'
9
9
  export const KEYWORDS = {
10
10
  RECURSION: 'rec',
11
11
  NUMBER_TYPE: 'number',
12
+ LIST_TYPE: 'list',
12
13
  ARRAY_TYPE: 'array',
13
14
  IDENTITY: 'identity',
14
15
  ARRAY_LENGTH: 'length',