Skip to contents

bandicoot OOP tools

Tools for building an OOP system

register_method()
Register method for an object environment
new_class()
Define a new class
copy_attr()
Copy attributes and methods from classes or instances
use_method()
Use a method in an object environment
super()
Get the parent class (the next class based on the method resolution order)
is_bandicoot_oop()
Check whether the object is a bandicoot_oop object
as_bandicoot_oop()
Turn an environment into a bandicoot_oop object

Portals to class instantiate methods

Functions to build an instance

base_()
BASE class environment

Base class

BASE class

base_()
BASE class environment
BASE$..type..
Class name
BASE$..class..
Class name and parent class names
BASE$..class_tree..
Class name and parent class names represented in a tree
BASE$..bases..
Direct parent classes
BASE$..mro..
Method resolution order
BASE$..method_env..
The container
BASE$..instantiated..
Instantiate status
BASE$..len..
Length of the class or the instance
BASE$..dir..
All names in the class or instance environment
BASE$..str..
String representation of the object
BASE$..repr..
"Official" String representation of the object
BASE$..methods..
List all methods of a class or an instance
BASE$..new..
Build a new instance from a class or an instance
BASE$..init..
Initialization method
BASE$instantiate
Instantiate method
BASE$has_attr
Whether or not an attribute or method exists
BASE$get_attr
Get value of an attribute or a method
BASE$set_attr
Set value of an attribute or a method
BASE$del_attr
Delete an attribute

S3 methods for building python-like interface

S3 methods for building python-like interface

print(<bandicoot_oop>)
S3 method of printing bandicoot_oop object
repr()
The "official" string representation of an object.
repr(<bandicoot_oop>)
S3 method of computing the "official" string representation of a bandicoot_oop object
len()
Compute the length of the object
len(<bandicoot_oop>)
S3 method of computing the length of bandicoot_oop object
iter()
Build an iterator
iter(<bandicoot_oop>)
S3 method of building an iterator of a bandicoot_oop object
`%contains%`(<bandicoot_oop>)
S3 method of performing membership test operator of a bandicoot_oop object
`%contains%`
Membership test operator
`%eq%`(<bandicoot_oop>)
S3 method of performing the equals to operator of a bandicoot_oop object
`%eq%`
The equals to operator
`%-=%`(<bandicoot_oop>)
S3 method of in-place subtraction operator of a bandicoot_oop object
`%-=%`
In-place subtraction operator
`%ge%`(<bandicoot_oop>)
S3 method of performing the greater or equals operator of a bandicoot_oop object
`%ge%`
The greater or equals to operator
`%-%`(<bandicoot_oop>)
S3 method of subtraction operator of a bandicoot_oop object
`%-%`
Subtraction operator
`%gt%`(<bandicoot_oop>)
S3 method of performing the greater than operator of a bandicoot_oop object
`%gt%`
The greater than operator
`%le%`(<bandicoot_oop>)
S3 method of performing the less or equals operator of a bandicoot_oop object
`%le%`
The less or equals to operator
`%lt%`(<bandicoot_oop>)
S3 method of performing the less than operator of a bandicoot_oop object
`%lt%`
The less than operator
`%ne%`(<bandicoot_oop>)
S3 method of performing the not equals to operator of a bandicoot_oop object
`%ne%`
The not equals to operator
`%+=%`(<bandicoot_oop>)
S3 method of in-place addition operator of a bandicoot_oop object
`%+=%`
In-place addition operator
`%+%`(<bandicoot_oop>)
S3 method of addition operator of a bandicoot_oop object
`%+%`
Addition operator

Utilties

Utility functions

define_pkg_fn()
Load functions from package namespaces into current environment
bind_fn_2_env()
Bind functions of the current environment to a target environment
sub_fn_body_name()
Substitute a symbol in a function body
check_method()
Check each method body in an object if it contains names that do not explicitly bind to a specified namespace via ::.