fez-lisp 1.5.61 → 1.5.63

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.61",
5
+ "version": "1.5.63",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -81,8 +81,8 @@ const formatType = (name, env) => {
81
81
  ? `${name} (${(stats[ARGUMENTS] ?? [])
82
82
  .map(
83
83
  (x) =>
84
- `${x[STATS][SIGNATURE]} ${x[STATS][TYPE_PROP].map(
85
- toTypeNames
84
+ `${x[STATS][SIGNATURE]} ${x[STATS][TYPE_PROP].map((x) =>
85
+ toTypeNames(x)
86
86
  ).join(' ')}${
87
87
  getSuffix(x[STATS][SIGNATURE]) === PREDICATE_SUFFIX
88
88
  ? ' ' + toTypeNames(PREDICATE)
@@ -1259,9 +1259,12 @@ export const typeCheck = (ast) => {
1259
1259
  const isKnown = T[TYPE_PROP][0] !== UNKNOWN
1260
1260
  switch (first[VALUE]) {
1261
1261
  case 'xs':
1262
+ case 'arr':
1263
+ case 'matrix':
1264
+ case 'table':
1262
1265
  if (isKnown && T[TYPE_PROP][0] !== COLLECTION) {
1263
1266
  warningStack.add(
1264
- `A variable named xs must be of type (${
1267
+ `A variable named ${first[VALUE]} must be of type (${
1265
1268
  STATIC_TYPES.COLLECTION
1266
1269
  }) but got type (${toTypeNames(
1267
1270
  T[TYPE_PROP][0]
@@ -1646,6 +1649,16 @@ export const typeCheck = (ast) => {
1646
1649
  }
1647
1650
  for (let i = 0; i < params.length; ++i) {
1648
1651
  const param = params[i]
1652
+ // TODO move this somewhere else
1653
+ if (!isLeaf(param)) {
1654
+ warningStack.add(
1655
+ `Invalid body for (${
1656
+ first[VALUE]
1657
+ }) if it takes more than one expression it must be wrapped in a (${
1658
+ KEYWORDS.BLOCK
1659
+ }) (${stringifyArgs(exp)}) (check #666)`
1660
+ )
1661
+ }
1649
1662
  copy[param[VALUE]] = {
1650
1663
  [STATS]: {
1651
1664
  [SIGNATURE]: param[VALUE],