CXXR (C++ R)
|
Context typically recording the call of a Closure. More...
#include <ClosureContext.hpp>
Public Member Functions | |
ClosureContext (const Expression *the_call, Environment *call_env, const FunctionBase *function, Environment *working_env, const PairList *promise_args) | |
Constructor. | |
RObject * | handlerStack () const |
(Not for general use.) | |
RObject * | onExit () const |
on.exit code. | |
const PairList * | promiseArgs () const |
Call arguments wrapped in Promises. | |
void | setOnExit (RObject *onexit) |
Designate an on.exit object. | |
Environment * | workingEnvironment () const |
Working environment of the Context's Closure. | |
Public Member Functions inherited from CXXR::FunctionContext | |
FunctionContext (const Expression *the_call, Environment *call_env, const FunctionBase *function) | |
Constructor. | |
const Expression * | call () const |
The call of the Context. | |
Environment * | callEnvironment () const |
The call Environment. | |
const FunctionBase * | function () const |
Function being applied. | |
RObject * | sourceLocation () const |
Source location associated with this Context. | |
Public Member Functions inherited from CXXR::Evaluator::Context | |
Context * | nextOut () const |
Next Context out. | |
Type | type () const |
Type of the Context. |
Static Public Member Functions | |
static ClosureContext * | innermost (Evaluator::Context *start=Evaluator::Context::innermost()) |
Search outwards for a ClosureContext. |
Context typically recording the call of a Closure.
The normal use of a ClosureContext is to record the application of a Closure.
However, ClosureContext objects are also created by do_eval(), DispatchOrEval() and tryDispatch() (all in eval.cpp), and in such cases the function parameter to the constructor may be null, or point to a BuiltInFunction rather than a Closure, and the arguments listed by the promise_args parameter may not actually be wrapped in Promise objects.
ClosureContext::ClosureContext | ( | const Expression * | the_call, |
Environment * | call_env, | ||
const FunctionBase * | function, | ||
Environment * | working_env, | ||
const PairList * | promise_args | ||
) |
Constructor.
the_call | Pointer to the call with which this Context is associated. |
call_env | Pointer to the Environment in which the_call is to be evaluated. |
function | Pointer to the FunctionBase being applied. Normally this will be a Closure. |
working_env | Pointer to the working environment of the Closure, i.e. the environment in which assignments create bindings, and in which default values of parameters are evaluated. |
promise_args | Pointer, possibly null, to the list of arguments to the call, each wrapped in a Promise. |
|
inline |
(Not for general use.)
This function will be removed in future refactorization.
|
static |
Search outwards for a ClosureContext.
This function works outwards from the Evaluator::Context start until it finds a ClosureContext (possibly start itself), and returns a pointer to that ClosureContext.
start | The Evaluator::Context from which the search is to start. |
Reimplemented from CXXR::FunctionContext.
|
inline |
on.exit code.
|
inline |
Call arguments wrapped in Promises.
|
inline |
Designate an on.exit object.
onexit | Pointer, possibly null, to an RObject to be evaluated on exit from the Context, whether by normal exit or by propagation of a C++ exception. |
|
inline |