type: Create a Q7 Type

View source: R/core.R

typeR Documentation

Create a Q7 Type

Description

Create a Q7 Type

Usage

type(fn = function() {
}, s3 = "Q7default")

Arguments

fn

function; becomes the definition of the object

s3

S3 class for the object; necessary when using S3 generic functions

Value

Q7 type; function

Examples


Adder <- type(function(num1, num2){
    add_nums <- function(){
        num1 + num2
    }
 })

myAdder <- Adder(1, 2)
myAdder$add_nums()


iqis/foo documentation built on March 27, 2022, 8:43 p.m.