|
| 1 | +# MeTTaScript 2.5.1 |
| 2 | + |
| 3 | +A `metta check` accuracy fix. The static analyzer stopped reporting false arity errors on overloaded doc |
| 4 | +atoms and on operators used as data, and it now resolves `import!` targets the way `run` does, so a clean |
| 5 | +multi-file program checks clean. The engine is unchanged: no program's evaluation or output differs, only |
| 6 | +the diagnostics `metta check` reports. |
| 7 | + |
| 8 | +## Overloaded doc atoms check clean |
| 9 | + |
| 10 | +The standard library declares `@param` and `@return` twice, an informal one-argument form and a formal |
| 11 | +two-argument form, and `@doc` with both a short and a long arity. The checker compared each call against a |
| 12 | +single kept signature, so the one-argument `(@param "...")` and `(@return "...")` the stdlib itself uses |
| 13 | +everywhere were flagged as arity errors. A call is now well-formed when its argument count matches any |
| 14 | +declared overload, the same rule `check_if_function_type_is_applicable` follows when it tries every |
| 15 | +function type of an operator. |
| 16 | + |
| 17 | +## Operators carried as data are not checked as calls |
| 18 | + |
| 19 | +An argument a form leaves unevaluated is data, not a call: a `case` clause pattern, an `if` branch, a |
| 20 | +`let` binding pattern, a `match` or `unify` pattern, a quoted term. The interpreter never applies it, so |
| 21 | +its head is never arity-checked, even when that head is a stdlib operator reused as an object-language |
| 22 | +symbol such as `(forall)`, `(and ...)`, or `(* ...)`. The checker now reads each operator's own signature |
| 23 | +to find these positions, the `Atom`, `Variable`, and `Expression` parameter slots the spec's `metta` |
| 24 | +returns as-is, and skips them, so it flags exactly what the interpreter would evaluate. |
| 25 | + |
| 26 | +## Cross-file signatures are resolved |
| 27 | + |
| 28 | +`metta check` now resolves a file's `import!` targets and analyzes it against the imported declarations, |
| 29 | +the same import graph `run` builds. A call to an operator whose type lives in another module is checked |
| 30 | +against that real signature instead of reading as an untyped head whose arguments all evaluate, so a |
| 31 | +formula carried in an imported operator's `Atom`-typed parameter is correctly treated as data. An |
| 32 | +unreadable import contributes nothing, and the check degrades to the single-file result. |
| 33 | + |
1 | 34 | # MeTTaScript 2.5.0 |
2 | 35 |
|
3 | 36 | Four engine changes: repeated queries over a knowledge base that has not changed now reuse their |
|
0 commit comments