val
result = val(x)
Input: x · Output: result
What it is
Materializes a value; currently the identity on any x (:= is already eager pre-M4) but will force evaluation of a deferred binding once M4 lazy fusion lands.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = val(x) | x —not documented yet | result — | Returns x unchanged, same type and shape. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
A = [1, 2, 3; 4, 5, 6]
x = 5
print("val={val(x)}")
print(transpose(A))
print("mirror={mirror([1, 2, 3])}")
output
val=5 [1, 4; 2, 5; 3, 6] mirror=[3, 2, 1]
from core-math
How it works
val(x) materializes a value: today := is already eager (M2), so val is the identity; it becomes meaningful once deferred dataflow bindings (§11) are lazily fused at M4, where val(x) forces evaluation instead of inlining the view.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.