You need to include module /pliant/language/compiler.pli when using Expression data type.
See pliant computing mechanism for a general introduction on meta-programming


The various arguments locations (where field) are defined in argument1.pli
argument_constant the argument is a constant
argument_register the argument is a processor register
argument_a_register the argument will be processor register, but the optimizer is responsible for choosing which
argument_local the argument is data on the stack, or will be a register if the data type is atomic and scalar and the optimizer finds an available register
argument_indirect the argument is a data in memory which address is the sum of the value of the pointer and the offset

Fields in the Argument data type:
Field name Type Content
type Link Type the type of the argument
where Int what kind of argument is it (see below for more details)
name Str guess it :-)

The following fields in the Argument data type can be used only when the where field has the right value:
Field name where field value Type Content
constant argument_constant Arrow pointer to the value of the constant
register argument_register Int number of the processor register
pointer argument_indirect Link Argument pointer to the argument that contains the pointer value
offset argument_indirect Int the offset to add to the pointer value to get the address of the pointed data

Other fields in the Argument data type, that are not used while compiling but rather while optimizing and generating code:
Field name Type Content
first_instruction Pointer Instruction pointer to the first instruction that uses this argument
last_instruction Pointer Instruction last one
requires List List of arrows to all objects that are required to ensure that the argument value is valid (as an example, if the argument is a pointer to a field of a constant, then we must be sure that the constant is not freed, so we add add it to the list)
user_field address


method a locate type where
  arg_rw Argument a ; arg Type type ; arg Int where

Sets the new type and location of the argument.


function argument constant type value -> a
  arg Type type ; arg Universal value ; arg_RW Argument a

function argument mapped_constant type value -> a
  arg Type type ; arg Universal value ; arg_RW Argument a

function argument local type -> a
  arg Type type ; arg_RW Argument a

function argument indirect type pointer offset -> a
  arg Type type ; arg Argument pointer ; arg Int offset ; arg_RW Argument a

function argument a_register -> a
  arg_RW Argument a

function argument register number -> a
  arg Type type ; arg Int number ; arg_RW Argument a

Builds a new argument.
This function is defined in argument2.pli