Next: , Previous: , Up: compiler   [Index]


17.12 Rewriting references and assignments

References to bindings in recordised code are represented as standalone prelex structures; assignments to bindings in recordised code are represented as assign structs:

(assign ?prel ?rhs)

in which ?prel is a prelex structure and the right–hand side ?rhs is recordised code which, evaluated at run–time, will return the new binding’s value.

With respect to how references and assignments are actually implemented, there are three kinds of lexical bindings:

The following bindings are exported by the library (vicare compiler).

Function: pass-rewrite-references-and-assignments input

Perform code transformations traversing the whole hierarchy in input, which must be a struct instance representing recordised code, and building a new hierarchy of recordised code; return the new hierarchy.

Transform references and assignments for top level lexical bindings and unassigned local lexical bindings according to the implementation of such operations. Remembering that the actual value of a top level binding is stored in the value field of a loc gensym, this function performs the following transformations:

After this compiler pass: there are no more assign structs in the returned recordised code.


Next: , Previous: , Up: compiler   [Index]