BASE {bandicoot}R Documentation

BASE class environment

Description

This class provides essential attributes and methods. It makes the assumption that the container name is ..method_env.. and the name of the reference to self is self. If you would like to use other container names and self names, you need to overwrite the class definition of BASE.

The class environment is defined as an empty environment by new.env() at build-time, and the class descriptor is run at load-time by .onLoad(). This ensures methods and attributes of the class is built with the load-time (usually latest) installed dependencies (if it depends on any). Derived classes should follow the same principle to avoid running the class descriptor at build-time, and only defines the content of the class at load-time.

Since bandicoot does not support dynamic dispatch, calling the correct parent method can be difficult in a complex class system. So, users can use the ..mro.. (method resolution order) attribute and the super() function to determine the correct super/next class. If users decide to store parent environments in the derived class such that parent method can be called more handily, awareness needs to be raised when saving and loading these classes/instances. It is very likely the same class stored in different objects becomes different environments.

Usage

base_(..., env = new.env(parent = parent.frame()), init_call = sys.call())

Arguments

...

Ignored.

env

Environment. The instance environment.

init_call

Call. Contents of the ..init_call... It is recommended to leave it as default.

Value

An instance environment.

Functions

Class information

Attributes

Methods


[Package bandicoot version 1.0.0 Index]