Calling functions with array arguments #
The library's sumPair takes two array references and calls the same sum
implementation twice. Its source calls pass one typed handle per array; the
existing compiler evaluates the two word fields at each call site.
The list concatenation below is only a mathematical description of the returned sum. Neither concatenation, allocation nor data loading is claimed to occur in the implementation. Read-only references may overlap. The runnable example starts with four explicitly preloaded heap words and requires no I/O driver or instruction budget.
Two real array calls compute the sum of the concatenated mathematical lists, without constructing that concatenation in machine memory.
Execute the typed two-array function on already represented 32-bit data. The returned count includes both inner calls, the outer call, return and halt.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The executable call returns the mathematical concatenation sum and its actual full transition count. Stack capacity is a safety premise, not a supplied runtime limit. All calls and returns are counted; host-side preloading is not.