Vita
Public Member Functions | List of all members
vita::symbol_params Class Referenceabstract

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...
 

Detailed Description

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:

Examples
example6.cc.

Definition at line 35 of file core_interpreter.h.

Member Function Documentation

◆ fetch_arg()

virtual value_t vita::symbol_params::fetch_arg ( unsigned  )
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 >.

◆ fetch_opaque_arg()

virtual value_t vita::symbol_params::fetch_opaque_arg ( unsigned  )
pure virtual

Fetches a specific input parameter without assuming referential transparency.

Remarks
Sometimes return value is ignored: typically for agent simulation (the caller is only interested in the side effects of the call).

Implemented in vita::interpreter< i_mep >.

◆ fetch_param()

virtual terminal_param_t vita::symbol_params::fetch_param ( ) const
pure virtual

Implemented in vita::interpreter< i_mep >.

◆ fetch_var()

virtual value_t vita::symbol_params::fetch_var ( unsigned  )
inlinevirtual

Definition at line 56 of file core_interpreter.h.

◆ operator[]()

value_t vita::symbol_params::operator[] ( unsigned  i)
inline

Equivalent to fetch_arg().

Definition at line 52 of file core_interpreter.h.


The documentation for this class was generated from the following file: