{ "schema": "ailang/v0", "name": "heap_str_repeated_print_borrow", "imports": [], "defs": [ { "kind": "fn", "name": "main", "type": { "k": "fn", "params": [], "ret": { "k": "con", "name": "Unit" }, "effects": ["IO"] }, "params": [], "doc": "Iter eob.1: heap-Str passed to io/print_str twice in sequence. Under the new rule (Term::Do args = Borrow), the second call no longer triggers use-after-consume; the linearity check accepts the program. Under --alloc=rc + AILANG_RC_STATS=1 the slab allocates once and is freed once at scope close (allocs == 1, frees == 1, live == 0).", "body": { "t": "let", "name": "s", "value": { "t": "app", "fn": { "t": "var", "name": "int_to_str" }, "args": [{ "t": "lit", "lit": { "kind": "int", "value": 42 } }] }, "body": { "t": "seq", "lhs": { "t": "do", "op": "io/print_str", "args": [{ "t": "var", "name": "s" }] }, "rhs": { "t": "do", "op": "io/print_str", "args": [{ "t": "var", "name": "s" }] } } } } ] }