fez-lisp 1.5.133 → 1.5.135

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.133",
5
+ "version": "1.5.135",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/compiler.js CHANGED
@@ -42,6 +42,17 @@ const toCamelCase = (name) => {
42
42
  const dashToLodashes = (name) => name.replace(new RegExp(/-/g), '_')
43
43
  const keywordToHelper = (name) => {
44
44
  switch (name) {
45
+ case STATIC_TYPES.ABSTRACTION:
46
+ case STATIC_TYPES.COLLECTION:
47
+ case STATIC_TYPES.UNKNOWN:
48
+ case STATIC_TYPES.ATOM:
49
+ case STATIC_TYPES.PREDICATE:
50
+ case STATIC_TYPES.ANY:
51
+ case STATIC_TYPES.NUMBER:
52
+ case DEBUG.ASSERT:
53
+ case DEBUG.LOG:
54
+ case DEBUG.STRING:
55
+ return '__identity'
45
56
  case TRUE_WORD:
46
57
  return '__true'
47
58
  case FALSE_WORD:
@@ -114,7 +125,7 @@ const Helpers = {
114
125
  or: `or=(a, b)=>+(a||b)`,
115
126
  get: 'get=(arr,i)=>arr[i]',
116
127
  length: 'length=(arr)=>arr.length',
117
- __tco: `__tco=fn=>(...args)=>{let result=fn(...args);while(typeof result==='function')result=result();return result}`,
128
+ __identity: `__identity=(x)=>x`,
118
129
  atom_predicate: `atom_predicate=(number)=>+(typeof number==='number')`,
119
130
  lambda_predicate: `lambda_predicate=(fn)=>+(typeof fn==='function')`,
120
131
  __error: `__error=(error)=>{throw new Error(error.map((x)=>String.fromCharCode(x)).join(''))}`,
package/src/types.js CHANGED
@@ -1222,8 +1222,8 @@ export const formatSubType = (T) => {
1222
1222
  ? formatSubType([x])
1223
1223
  : toTypeNamesAnyToUknown(x)
1224
1224
  )
1225
- .join(' ')
1226
- : toTypeNamesAnyToUknown(ANY)
1225
+ .join(' ') || toTypeNames(UNKNOWN)
1226
+ : toTypeNames(UNKNOWN)
1227
1227
  }]`
1228
1228
  case ATOM:
1229
1229
  return `${