CXXR (C++ R)
Classes | Namespaces | Functions
Closure.h File Reference

($Id: Closure.h 1353 2013-03-18 16:59:38Z arr $)

Class CXXR::Closure and associated C interface. More...

#include "CXXR/FunctionBase.h"
#include <boost/serialization/access.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_member.hpp>
#include "CXXR/ArgMatcher.hpp"
#include "CXXR/Environment.h"
#include "CXXR/PairList.h"
Include dependency graph for Closure.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CXXR::Closure
 Class representing a functional programming closure. More...

Namespaces

namespace  CXXR
 Namespace for the CXXR project.

Functions

template<class Archive >
void boost::serialization::load_construct_data (Archive &ar, CXXR::Closure *t, const unsigned int version)
 Template specialisation.
SEXP Rf_mkCLOSXP (SEXP formal_args, SEXP body, SEXP env)
 Create a CXXR::Closure object.
SEXP BODY (SEXP x)
 Access the body of a CXXR::Closure.
SEXP CLOENV (SEXP x)
 Access the environment of a CXXR::Closure.
SEXP FORMALS (SEXP x)
 Access formal arguments of a CXXR::Closure.
Rboolean RDEBUG (SEXP x)
 Query debugging status.
int RSTEP (SEXP x)
void SET_CLOENV (SEXP x, SEXP v)
 Replace the environment of a closure.
void SET_RDEBUG (SEXP x, Rboolean v)
void SET_RSTEP (SEXP x, int v)

Detailed Description

Class CXXR::Closure and associated C interface.


Function Documentation

SEXP BODY ( SEXP  x)
inline

Access the body of a CXXR::Closure.

Parameters:
xPointer to a CXXR::Closure object (checked).
Returns:
Pointer to the body of x.
SEXP CLOENV ( SEXP  x)
inline

Access the environment of a CXXR::Closure.

Parameters:
xPointer to a CXXR::Closure object (checked).
Returns:
Pointer to the environment of x.
SEXP FORMALS ( SEXP  x)
inline

Access formal arguments of a CXXR::Closure.

Parameters:
xPointer to a CXXR::Closure object (checked).
Returns:
Pointer to the formal argument list of x.
Rboolean RDEBUG ( SEXP  x)
inline

Query debugging status.

Parameters:
xPointer to a CXXR::Closure object.
Returns:
true if debugging is set, i.e. evaluations of the function should run under the browser.
Note:
In CXXR, RDEBUG() is applicable only to closures; use ENV_DEBUG() to query the debugging (single-stepping) state for environments.
SEXP Rf_mkCLOSXP ( SEXP  formal_args,
SEXP  body,
SEXP  env 
)

Create a CXXR::Closure object.

Parameters:
formal_argsPointer to a CXXR::PairList (checked) of formal arguments.
bodyPointer to the body of the CXXR::Closure. This must be either a null pointer or a pointer to an object of one of the following types: LISTSXP, LANGSXP, SYMSXP, EXPRSXP, VECSXP or BCODESXP (checked).
envpointer to the CXXR::Environment (checked) in which the closure is to be evaluated.
Returns:
pointer to the created closure object.
void SET_CLOENV ( SEXP  x,
SEXP  v 
)
inline

Replace the environment of a closure.

Parameters:
xPointer to a CXXR::Closure object (checked).
vPointer to the environment now to be considered as the environment of this CXXR::Closure. A null pointer is not permissible (not checked).
void SET_RDEBUG ( SEXP  x,
Rboolean  v 
)
inline

Set the debugging state of a CXXR::Closure object.

Parameters:
xPointer a CXXR::Closure object (checked).
vThe new debugging state.
Note:
In CXXR, SET_RDEBUG() is applicable only to closures; use SET_ENV_DEBUG() to set the debugging (single-stepping) state for environments.