The Meta Instruction Set - Generated function calls.

++Call.

One very powerful feature of meta code is its ability to make function calls based on model design data.

This allows the generated code to reflect the current state of the Obsydian model, which obviously changes over time, and also allows functions to written in the abstract without knowing what the final application model will look like.

The instruction has two forms, one which takes a verb as its first parameter and the second has a meta variable as the first parameter.

The Verb Form.

Any verb with a function as its target can be used with the ++Call instruction. A call is generated to the target function if the triple exists for the current meta source object. This form is used in many function of OBASE. For example:

 

The Meta Variable Form.

This form of the instruction will generate a function call when the meta variable used as the parameter contains a reference to a function object.

Parameter mapping.

Since most function calls involve the passing of parameters, the meta generator has a built in algorithm to determine formal to actual parameter mappings. It uses the current meta source objects it has available, mainly fields and variables, to produce a parameter map. Sometimes this will result in a field not being mapped. In this case, an empty value is passed to the called function for the field concerned.

To allow you to fine tune the resolved parameter map, you can add a list of variables as parameters to the ++Call instruction. The meta generator uses this list to find any candidate fields for the actual parameters.

Parameter limitations.

Any output parameters from a called function appear in a variable specific to the called function. This variable is not available for functions called through meta code and so any output values from the called function are ignored with the exception of the special Environment<*Returned status> field. This is set in the normal way and so can be used to determine the result of a function call.

Another way to get around this limitation is to make the fields dual parameters. Any values for dual fields are returned to the field in the calling function that was automatically mapped.

Go to: Top : Next page