fez-lisp 1.5.39 → 1.5.40

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/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.5.39",
5
+ "version": "1.5.40",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -571,7 +571,10 @@ export const typeCheck = (ast) => {
571
571
  env[re[0][VALUE]][STATS].type
572
572
  env[name][STATS][SUB_RETURN_TYPE] =
573
573
  env[re[0][VALUE]][STATS][SUB_RETURN_TYPE]
574
- } else env[name][STATS][RETURNS] = UNKNOWN
574
+ } else {
575
+ env[name][STATS][RETURNS] = UNKNOWN
576
+ // env[name][STATS][RETURNS] = APPLY
577
+ }
575
578
  }
576
579
  break
577
580
  default:
@@ -589,6 +592,7 @@ export const typeCheck = (ast) => {
589
592
  }
590
593
  } else {
591
594
  env[name][STATS][RETURNS] = UNKNOWN
595
+ // env[name][STATS][RETURNS] = APPLY
592
596
  }
593
597
  break
594
598
  }
package/src/macros.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  FALSE,
11
11
  KEYWORDS,
12
12
  PLACEHOLDER,
13
+ PREDICATE_SUFFIX,
13
14
  TRUE,
14
15
  TYPE,
15
16
  VALUE,
@@ -523,6 +524,11 @@ export const deSuggarAst = (ast, scope) => {
523
524
  const name = exp[1][VALUE]
524
525
  const prefix = name.split(':')[0]
525
526
  if (prefix === OPTIMIZATIONS.RECURSION) {
527
+ if (name[name.length - 1] === PREDICATE_SUFFIX) {
528
+ throw new TypeError(
529
+ `Optimized (lambda) ${name} can't be a (Predicate) as it will return a (lambda). Remove the (${PREDICATE_SUFFIX}) from the name`
530
+ )
531
+ }
526
532
  const args = last.slice(1, -1)
527
533
  const newName = `*${performance
528
534
  .now()
@@ -619,6 +625,11 @@ export const deSuggarAst = (ast, scope) => {
619
625
  ]
620
626
  deSuggarAst(exp[exp.length - 1])
621
627
  } else if (prefix === OPTIMIZATIONS.CACHE) {
628
+ if (name[name.length - 1] === PREDICATE_SUFFIX) {
629
+ throw new TypeError(
630
+ `Optimized (lambda) ${name} can't be a (Predicate) as it will return a (lambda). Remove the (${PREDICATE_SUFFIX}) from the name`
631
+ )
632
+ }
622
633
  const args = last.slice(1, -1)
623
634
  const newName = `*${performance
624
635
  .now()