fez-lisp 1.5.159 → 1.5.160

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.159",
5
+ "version": "1.5.160",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -1132,6 +1132,7 @@ export const typeCheck = (ast, ctx = SPECIAL_FORM_TYPES) => {
1132
1132
  exp
1133
1133
  )})`
1134
1134
  )
1135
+
1135
1136
  if (name in env) {
1136
1137
  Types.set(withScope(name, env), () => formatType(name, env))
1137
1138
  break
@@ -1175,6 +1176,7 @@ export const typeCheck = (ast, ctx = SPECIAL_FORM_TYPES) => {
1175
1176
  name,
1176
1177
  check
1177
1178
  })
1179
+ // TODO: remove this as maybe it is not needed
1178
1180
  check(rightHand, env, exp)
1179
1181
  })
1180
1182
  check(rightHand, env, exp)
@@ -1312,9 +1314,9 @@ export const typeCheck = (ast, ctx = SPECIAL_FORM_TYPES) => {
1312
1314
  })
1313
1315
  break
1314
1316
  default:
1315
- if (copy[ret[VALUE]])
1317
+ if (copy[ret[VALUE]]) {
1316
1318
  setReturnRef(ref[STATS], copy[ret[VALUE]][STATS])
1317
- else
1319
+ } else
1318
1320
  stagger(stack, 'append', [ret, copy], () => {
1319
1321
  if (copy[ret[VALUE]])
1320
1322
  setReturnRef(ref[STATS], copy[ret[VALUE]][STATS])
package/src/utils.js CHANGED
@@ -175,10 +175,13 @@ const isDefinition = (x) =>
175
175
  x[TYPE] === APPLY && x[VALUE] === KEYWORDS.DEFINE_VARIABLE
176
176
  // [[, [, libs]]] is because std is wrapped in (apply (lambda (do ...)))
177
177
  const toDeps = ([[, [, libs]]]) =>
178
- libs.reduce(
179
- (a, x, i) => a.set(x.at(1)[VALUE], { value: x, index: i }),
180
- new Map()
181
- )
178
+ // slice 1 so we get rid of do
179
+ libs
180
+ .slice(1)
181
+ .reduce(
182
+ (a, x, i) => a.set(x.at(1)[VALUE], { value: x, index: i }),
183
+ new Map()
184
+ )
182
185
  const deepShake = (tree, deps, visited = new Set(), ignored = new Set()) => {
183
186
  const type = tree[TYPE]
184
187
  const value = tree[VALUE]