R/struct.R
fields.Rd
Field names of a struct or an instance
fields(x)
A struct, an instance, an S7 class or object, or anything as_type() accepts.
as_type()
A character vector, in declaration order.
Pt <- struct("Pt", x = num[1], y = num[1]) fields(Pt) #> [1] "x" "y" fields(Pt(x = 1, y = 2)) #> [1] "x" "y"