templates {constructive}R Documentation

Extend constructive

Description

.cstr_new_class() and .cstr_new_constructor() open new unsaved scripts, optionally commented, that can be used as templates to define new constructors. If the class is already supported and you want to implement a new constructor, use .cstr_new_constructor(), otherwise use .cstr_new_class().

Usage

.cstr_new_class(
  class = c("CLASS", "PARENT_CLASS"),
  constructor = "PKG::CONSTRUCTOR",
  commented = FALSE
)

.cstr_new_constructor(
  class = c("CLASS", "PARENT_CLASS"),
  constructor = "PKG::CONSTRUCTOR",
  commented = FALSE
)

Arguments

class

Class to support, provide the full class() vector.

constructor

Name of the constructor, usually the name of the function you can to use to build the object. If not you might need to adjust the script.

commented

Boolean. Whether to include comments in the template.

Details

We suggest the following workflow :

The README of the example extension package 'constructive.example' guides you through the process. See also {constructive}'s own code and vignette("extend-constructive") for more details.

Value

Both function return NULL invisibly and are called for side effects


[Package constructive version 1.0.1 Index]