Commit 7d5e7d0
committed
Type bind! and import! so a missing bang on them is reported
Both are interpreter forms that exist for their effect, but neither carried a
type declaration. `metta check` decides an operator is an action by reading the
unit return type `(->)` off its signature, so with no signature to read it could
not see either of them: a top-level `(bind! &s (new-space))` or
`(import! &self lib)` written without its leading `!` was stored as data, the
token stayed unbound and the module never loaded, and nothing said so. The first
symptom was a later match quietly finding nothing.
Declaring the types they already have fixes it, and the declarations are exact:
the token and the module name are Atom-typed because neither is reduced, while
bind!'s value is %Undefined% because it is, as in (bind! &s (new-space)). The
full suite passes unchanged, which is the check that the argument evaluation
these declarations imply is the evaluation that was already happening.1 parent 73a63a9 commit 7d5e7d0
2 files changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
217 | 226 | | |
218 | 227 | | |
219 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
0 commit comments