{ "schema": "ailang/v0", "name": "int_to_str_drop_rc", "imports": [], "defs": [ { "kind": "fn", "name": "main", "type": { "k": "fn", "params": [], "ret": { "k": "con", "name": "Unit" }, "effects": ["IO"] }, "params": [], "doc": "Iter hs.4: pin that `int_to_str` participates in RC discipline. Bind the heap-Str result to `s`, consume `s` once in `io/print_str`, let the binder drop at scope close. Under --alloc=rc with AILANG_RC_STATS=1 the atexit summary must report allocs == frees && live == 0 — the heap-Str slab allocated by str_alloc inside ailang_int_to_str rides the same rc_header + ailang_rc_dec path as any other RC value.", "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": "do", "op": "io/print_str", "args": [{ "t": "var", "name": "s" }] } } } ] }