Skip to content

Commit 970bc28

Browse files
committed
MeTTaScript 2.6.0
Bump every package to 2.6.0 and add the release notes for the stored-action diagnostic and the stringToChars/charsToString pair.
1 parent 911b2ba commit 970bc28

25 files changed

Lines changed: 68 additions & 24 deletions

File tree

RELEASE_NOTES.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
# MeTTaScript 2.6.0
2+
3+
Two additions. `metta check` now catches a top-level action form that is stored as data instead of run, and
4+
the standard library gained the pair of grounded ops that take a string apart into characters and put it
5+
back together. The engine is otherwise unchanged: no existing program's evaluation or output differs.
6+
7+
## A stored action form is reported
8+
9+
MeTTa evaluates a top-level form only when it carries a leading `!`; every other form is added to the space
10+
as data. That is what you want for a fact or a rule. It is not what you want for an op that exists for its
11+
effect, because such an op returns the unit type `(->)`, which produces nothing a later query can match. The
12+
stored call is inert: the assertion never checks, the `add-atom` never adds, the `println!` never prints.
13+
Nothing reports it, so an unbanged `assertEqualToResult` reads as a passing test.
14+
15+
`metta check` now warns on that form and offers to insert the `!`:
16+
17+
```
18+
warning: `assertEqualToResult` runs for its effect, so this top-level form is stored as data and never evaluated
19+
```
20+
21+
The check reads the unit return type from each op's own signature rather than from a list of builtin names,
22+
so an op you declare `(-> ... (->))` yourself is covered on the same footing as the assert family,
23+
`add-atom`, and `println!`. It is a warning, so it never changes the exit code and cannot break a gate. It
24+
stays quiet when the `!` is separated from its form by a comment, which still binds, when the op also
25+
carries a non-arrow type, and when the argument count matches no declared overload, since the arity error
26+
already names the real problem.
27+
28+
## Characters of a string
29+
30+
`atom_concat` joins symbols but cannot split one, so a name like `e1_ep` could not be taken apart into a base
31+
and a sort at run time. `stringToChars` splits a `String` into an `Expression` of single-character symbols
32+
and `charsToString` joins one back, matching hyperon-experimental and mettalog, where a character is a
33+
single-character symbol:
34+
35+
```metta
36+
!(stringToChars "e1_ep") ; (e 1 _ e p)
37+
!(let $cs (stringToChars "e1_ep") (charsToString $cs)) ; "e1_ep"
38+
```
39+
40+
The character list is ordinary data, so `car-atom`, `cdr-atom`, and `decons-atom` walk it. `charsToString`
41+
takes its list unevaluated, the way `car-atom` does, because the characters of `"+ab"` are `(+ a b)` and
42+
evaluating that argument would run an addition instead of joining it back; bind a computed list with `let`.
43+
Astral characters stay whole rather than splitting into surrogate halves.
44+
145
# MeTTaScript 2.5.1
246

347
A `metta check` accuracy fix. The static analyzer stopped reporting false arity errors on overloaded doc

compat/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/browser",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/core",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/das-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/das-client",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/das-gateway/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/das-gateway",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/debug/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/debug",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/edsl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/edsl",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/grapher/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/grapher",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/hyperon/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/hyperon",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

compat/libraries/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metta-ts/libraries",
3-
"version": "2.5.1",
3+
"version": "2.6.0",
44
"license": "MIT",
55
"type": "module",
66
"main": "./dist/index.js",

0 commit comments

Comments
 (0)