makeSymbolicVariables: Define R variables for native enumeration constants

makeSymbolicVariablesR Documentation

Define R variables for native enumeration constants

Description

This function is used to define R variables that correspond to the values of enumeration constants in C/C++.

Usage

makeSymbolicVariables(def, className = class(def), where = globalenv())

Arguments

def

a named vector of values. The names are used as the names of the R variables to be defined. The values are the values used for the values of the variables.

className

the name of the R class for each element being defined. This allows us to define classes for specific groups of enumerated values rather than using a generic class. This is currently only used for bitwise enumerations.

where

the environment in which to define the new R variables.

Value

The function is used for its side effects of defining new variables.

Author(s)

Duncan Temple Lang

Examples

  vals = c(Red = 1L, Green = 2L, Blue = 3L)
  makeSymbolicVariables(vals)

omegahat/RAutoGenRunTime documentation built on Jan. 12, 2023, 9:19 p.m.