fez-lisp 1.6.21 → 1.6.24
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/README.md +14 -15
- package/lib/baked/std-T.js +1 -1
- package/lib/baked/std.js +1 -1
- package/package.json +1 -1
- package/src/check.js +2 -3
- package/src/macros.js +20 -1
package/package.json
CHANGED
package/src/check.js
CHANGED
@@ -1205,9 +1205,8 @@ export const typeCheck = (ast, ctx = SPECIAL_FORM_TYPES) => {
|
|
1205
1205
|
)
|
1206
1206
|
if (name in env) {
|
1207
1207
|
Types.set(withScope(name, env), () => formatType(name, env))
|
1208
|
-
|
1209
|
-
|
1210
|
-
}
|
1208
|
+
// If current scope is root then these are user defined types
|
1209
|
+
if (env[SCOPE_NAME] === rootScopeIndex) break
|
1211
1210
|
}
|
1212
1211
|
// Predicate name consistency
|
1213
1212
|
const rightHand = rest.at(-1)
|
package/src/macros.js
CHANGED
@@ -37,7 +37,9 @@ export const SUGGAR = {
|
|
37
37
|
BIG_INT_DIVISION: 'Idiv',
|
38
38
|
BIG_INT_MULTIPLICATION: 'Imul',
|
39
39
|
NEW_BIG_INTEGER: 'new:big-integer',
|
40
|
-
PROMISES: '*DATA*'
|
40
|
+
PROMISES: '*DATA*',
|
41
|
+
VARIABLE: 'variable',
|
42
|
+
SET_VARIABLE: 'set'
|
41
43
|
}
|
42
44
|
export const deSuggarAst = (ast, scope) => {
|
43
45
|
if (scope === undefined) scope = ast
|
@@ -98,6 +100,23 @@ export const deSuggarAst = (ast, scope) => {
|
|
98
100
|
// }
|
99
101
|
// }
|
100
102
|
// break
|
103
|
+
case KEYWORDS.GET_ARRAY:
|
104
|
+
if (rest.length === 1) {
|
105
|
+
exp.push([ATOM, 0])
|
106
|
+
}
|
107
|
+
break
|
108
|
+
case SUGGAR.VARIABLE:
|
109
|
+
{
|
110
|
+
exp[0][VALUE] = 'let'
|
111
|
+
const temp = exp.pop()
|
112
|
+
exp.push([[APPLY, 'var:def'], temp])
|
113
|
+
}
|
114
|
+
deSuggarAst(exp.at(-1))
|
115
|
+
break
|
116
|
+
case SUGGAR.SET_VARIABLE:
|
117
|
+
exp[0][VALUE] = 'var:set!'
|
118
|
+
deSuggarAst(exp.at(-1))
|
119
|
+
break
|
101
120
|
case KEYWORDS.BLOCK:
|
102
121
|
{
|
103
122
|
if (rest.length === 0)
|