pointer {oosp}R Documentation

pointer objects

Description

Here, pointer objects are extended freemethods (refer to freemethod), that are used to reference an object refered to as the pointer image. Whilst the implementation may be unorthodox, these objects has been partly modelled around C pointers, including the ability to casually reference and deference objects. One major difference, is that we use pointers to vectors (or lists) rather than pointer arrays. We create a pointer, by calling ptr = pointer (obj) and reassign it, by map (ptr, newobj). We access the image by calling the pointer as a function, ptr (). If the image is a vector or list (and even if it isn't), we can manipulate and access the elements directly, using extraction methods. Note that the map function doesn't return a value.

Usage

pointer (obj)
pointer.image ()
## S3 method for class 'pointer':
map(ptr, obj, ...)
## S3 method for class 'pointer':
print(ptr, ...)
## S3 method for class 'pointer':
length(x)
## S3 method for class 'pointer':
ptr[...]
## S3 method for class 'pointer':
ptr[...] <- value
## S3 method for class 'pointer':
ptr[[...]]
## S3 method for class 'pointer':
ptr[[...]] <- value

Arguments

ptr
x
obj
value
...

[Package oosp version 0.2.3 Index]