Next: Why This Matters: Architectural Elegance, Up: The Mechanics of Evaluation: Snapshots vs. Live Streams   [Contents]


2.3.7.1 The EVAL Function: Killing the Link

Sometimes, you don’t want a live stream; you want to "freeze" a moment in time. This is where the EVAL() function comes into play. It forces the system to calculate the final result of an expression and store it as a static constant.

value = 1;

Hard-coded Constant.

value = time:hour;

Dynamic Reference (The value evolves with the hour).

value = EVAL(time:hour);

Frozen Value (Locks the hour at the moment of assignment).

value = 1 + time:hour;

Dynamic Calculation (The result updates as time moves).

value = EVAL(1 + time:hour);

Static Result (Calculates the sum once and stores the total).