3.2. kink/BINDING

The companion mod for local binding vals.

Example:

:BINDING.require_from('kink/')
:PROGRAM.require_from('kink/')
:Binding <- BINDING.new
:prog <- PROGRAM.compile('Num * 2'){(:C)
  C.binding(Binding)
}
Binding:Num <- 42
stdout.print_line(prog.repr) # => 84

3.2.1. type binding

A binding val, or “local binding” val is a holder of local variables, which can be used as a context binding register of execution of a Kink program.

See “Language specification” → “Kink Stack Machine (KSM)” chapter for context binding registers.

Local binding vals have the same variables as kink/CORE mod have when the runtime is initialized, except for CORE.repr.

Binding.repr

Binding.repr returns a str such as "Binding(val_id=42)".

3.2.2. BINDING.new

BINDING.new makes a new local binding.

3.2.3. BINDING.is?(Val)

BINDING.is? returns whether the Val is a local binding val.