A function computing the result of the invisible operator used to specify the virtual code semantics in Virtual Code Semantics, is easily available by way of a declaration in apply.h.
This function should be called by the client program at least once prior to the first call to
avm_apply
oravm_recoverable_apply
. It causes certain internal data structures and error message texts to be initialized.
This function should be used at the end of a run for the purpose of detecting and reporting any unreclaimed storage associated with functions in this section. If the function
avm_count_lists()
is also being used, it should be called after this one.
This is the function that evaluates the operator used to describe the virtual code semantics. For example, the value of f x can be obtained as the result returned by
avm_apply(
f,
x)
.Both parameters to this function are deallocated unconditionally and should not be referenced again by the caller. If the parameters are needed subsequently, then only copies of them should be passed to
avm_apply
usingavm_copied
.This function is not guaranteed to terminate, and may cause a memory overflow error. In the event of an exceptional condition, the error message is written to standard error and the program is halted. There is no externally visible distinction between different levels of error conditions.
This function is similar to
avm_apply
but leaves the responsibility of error handling with the caller. If any overflow or exceptional condition occurs, the result returned is a list representing the error message, and the fault flag is set to a non-zero value. This behavior contrasts with that ofavm_apply
, which will display the message to standard error and kill the process.