fez-lisp 1.5.80 → 1.5.81

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.80",
5
+ "version": "1.5.81",
6
6
  "type": "module",
7
7
  "main": "index.js",
8
8
  "keywords": [
package/src/check.js CHANGED
@@ -83,9 +83,10 @@ const fillUknownArgs = (n) =>
83
83
  }))
84
84
  export const formatType = (name, env) => {
85
85
  const stats = env[name][STATS]
86
+ const isAnonymous = typeof name === 'number'
86
87
  return stats
87
88
  ? stats[TYPE_PROP][0] === APPLY
88
- ? `${typeof name !== 'number' ? `${name} ` : ''}(${
89
+ ? `${isAnonymous ? '' : `(let ${name} `}(lambda ${
89
90
  stats[ARG_COUNT] === VARIADIC
90
91
  ? '... ' + STATIC_TYPES.UNKNOWN
91
92
  : (stats[ARGUMENTS] ?? [])
@@ -94,12 +95,18 @@ export const formatType = (name, env) => {
94
95
  `${
95
96
  x[STATS][TYPE_PROP][0] === APPLY
96
97
  ? `${formatType(i, stats[ARGUMENTS])}`
97
- : `${x[STATS][TYPE_PROP].map(toTypeNames).join(' ')}`
98
+ : `${toTypeNames(
99
+ x[STATS][TYPE_PROP][1] ?? x[STATS][TYPE_PROP][0]
100
+ )}`
98
101
  }`
99
102
  )
100
103
  .join(' ')
101
- }) -> ${toTypeNames(stats[RETURNS][1] ?? stats[RETURNS][0])}`
102
- : `${name} ${stats[TYPE_PROP].map(toTypeNames).join(' ')}`.trim()
104
+ } (${KEYWORDS.BLOCK} ${toTypeNames(
105
+ stats[RETURNS][1] ?? stats[RETURNS][0]
106
+ )})${isAnonymous ? '' : ')'})`
107
+ : `(let ${name} ${toTypeNames(
108
+ stats[TYPE_PROP][1] ?? stats[TYPE_PROP][0]
109
+ )})`
103
110
  : name
104
111
  }
105
112
  const formatTypes = (env) => {
@@ -122,7 +129,7 @@ const getScopeNames = (scope) => {
122
129
  }
123
130
  const withScope = (name, scope) => {
124
131
  const chain = getScopeNames(scope)
125
- return `${chain.length === 1 ? '· ' : ''}${chain
132
+ return `${chain.length === 1 ? '; ' : ''}${chain
126
133
  .map((x) => (Number.isInteger(+x) ? '::' : x))
127
134
  .join(' ')} ${name}`
128
135
  }
package/src/types.js CHANGED
@@ -31,7 +31,7 @@ export const toTypeNames = (type) => {
31
31
  }
32
32
  }
33
33
  export const SPECIAL_FORM_TYPES = {
34
- [SCOPE_NAME]: '·',
34
+ [SCOPE_NAME]: ';',
35
35
  [ORDER]: 0,
36
36
  [toTypeNames(APPLY)]: {
37
37
  [STATS]: {