The Escher faculty provides access to linguistic primitives from within program circuits.
Every running Escher circuit program has been materialized relative to an index.
The index reflex, e.Index
, is a noun reflex that emits the index relative to which
the current circuit has been materialized.
The following program, for instance, will print out the index used to materialize the invoking circuit program:
{ *e.Show = *e.Index }
The materialize reflex, named e.Materialize
,
materializes a program circuit relative to an index of faculties.
The reflex requires that two valves, :View
and :Residue
, be connected.
Values sent to :View
must be circuits containing gates named Index
and Program
.
The value of the Program
gate must be a circuit program (or any
gate value allowed within a circuit program). Whereas the value of the
Index
gate should hold the index, relative to which the program will be materialized.
When a value is received at :View
, the materialize reflex will materialize the
program relative to the given index and will return the residue to the valve :Residue
.
Consider the following example program:
{ m *e.Materialize f *e.Fork m:View = f: f:Program = { *e.Show = "Hello from the child circuit program." } f:Index = *e.Index m:Residue = *e.Show }
This program will materialize the child program
{ *e.Show = "Hello from the child circuit program." }
using the same index that was used to materialize the parent program, as acquired from
the *e.Index
reflex in the parent program.