Generate custom a functions based on available types.
a_class_factory.RdGenerate custom a functions based on available types.
Arguments
- x
Character vector. Names of the desired type functions.- prefix
Character scalar. Name of the prefix the class is from. (Default:"")- to.local
Logical scalar. Whether to return functions in a list (TRUE, Default) or to the environment (FALSE).- name.prepend
Character scalar. Prefix for the produced predicate functions. (Default:"C.").
Examples
C <- a_class_factory(x = c("class_A", "class_B", "class_C"))
C$C.class_A(?subject)
#> pallas::triple character S7_object.
#> subject predicate object
#> ?subject a class_A .
C$C.class_B(subject)
#> pallas::triple character S7_object.
#> subject predicate object
#> subject a class_B .
C$C.class_C("?subject")
#> pallas::triple character S7_object.
#> subject predicate object
#> ?subject a class_C .