Expand description
ref arguments bound to a window of a variable or class property
(LRM 1800-2023 13.5.2): f(s.n), f(v[3:0]), f(obj.x), f(g).
The callee accesses the actual directly, so a body that writes the same
storage through another path while it holds the ref (the module
variable, the class handle, a nested call) must see one location. A
compiled function holds such a ref as a reference id like an element
reference of a queue (collections::ref_open), but the id names a window
of a root image instead: the root’s bytes in the caller’s frame, or a
class property’s words in the object heap. The image is the packed value
(unk << W) | val of codegen (a 2-state build: val alone).
Ids carry WIN_BIT so they never collide with an element reference’s.
Constants§
- WIN_BIT
- Set in the id of every window reference.
Functions§
- close
- Closes window reference
id. - get_
part - Part
[lo, lo + w)of thebig_w-bit root that windowidnames, intooutas aw-bit packed(unk << w) | val. A bit past the root reads as 0.falsewhenidis no open window or its object is dead (outis then left alone). - is_
window - Whether
idnames a window reference. - open_
field - Opens a window reference on the class property
slotof objecth. - open_
mem ⚠ - Opens a window reference on the root image at
addr. - put_
part - Writes the
w-bit packedvalinto part[lo, lo + w)of the root that windowidnames, keeping the root’s other bits as they are now.