fez-lisp 1.5.134 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/compiler.js +12 -1
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.134",
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(''))}`,