JaggerScript / docsProject documentation

Reference

Expression Semantics

Look up syntax, contracts, layouts, algorithms, and exact behavior.

Expression evaluation is strict and eager. Arithmetic expressions evaluate the left operand, then each operation tail in order. Boolean expressions evaluate both sides and apply the relational or equality operator. Function calls evaluate argument expressions before binding them to the callee's parameter names.

eval⁡(a0  op1  a1…opn  an)=(((a0  op1  a1)  op2  a2)…opn  an)\operatorname{eval}(a_0\;op_1\;a_1\ldots op_n\;a_n)=(((a_0\;op_1\;a_1)\;op_2\;a_2)\ldots op_n\;a_n)
Arithmetic fold. The normalized arithmetic tail is evaluated as a left fold after grammar-level precedence has selected terms.
K′=K[sp+1][parami↦eval(argi)]K' = K[sp+1][param_i \mapsto eval(arg_i)]
Call binding. A function call pushes a frame and binds evaluated arguments by position.
doll.inner.value
  1. resolve doll in local frame or running instance scope
  2. assert doll is an Instance
  3. follow inner through doll.globalScope
  4. assert inner is an Instance
  5. read value from inner.globalScope
Scoped member access. Scope paths are resolved one object boundary at a time with instance assertions at every intermediate step.