Vita
|
An interface for parameter passing to functions / terminals. More...
#include <core_interpreter.h>
Inherited by vita::core_interpreter.
Public Member Functions | |
virtual value_t | fetch_arg (unsigned)=0 |
Fetches a specific input parameter assuming referential transparency. More... | |
virtual value_t | fetch_opaque_arg (unsigned)=0 |
Fetches a specific input parameter without assuming referential transparency. More... | |
virtual terminal_param_t | fetch_param () const =0 |
virtual value_t | fetch_var (unsigned) |
value_t | operator[] (unsigned i) |
Equivalent to fetch_arg(). More... | |
An interface for parameter passing to functions / terminals.
symbol_params is a subset of the core_interpreter interface. Coding a user defined function is more natural when you can think the input parameters as a simple array of values. Actually things are more complex but user doesn't have to know. The only detail you must remember is that parameters are lazy evaluated so:
fetch_arg(i)
(i.e. operator[](i)
) in a local variable for multiple uses;fetch_arg(i)
only if you need the i
-th argument. Definition at line 35 of file core_interpreter.h.
|
pure virtual |
Fetches a specific input parameter assuming referential transparency.
Referential transparency allows cache based optimization for argument retrieval. If this kind of optimization isn't required the implementation can be a simple call to fetch_upaque_arg
.
Implemented in vita::interpreter< i_mep >.
|
pure virtual |
Fetches a specific input parameter without assuming referential transparency.
Implemented in vita::interpreter< i_mep >.
|
pure virtual |
Implemented in vita::interpreter< i_mep >.
|
inlinevirtual |
Definition at line 56 of file core_interpreter.h.
|
inline |
Equivalent to fetch_arg().
Definition at line 52 of file core_interpreter.h.