Skip to contents

The IR document of a type: its namespace and its declaration, as JSON text.

Usage

r8declaration(type)

Arguments

type

An R8 type object.

Value

Character: The IR document.

Examples

op <- options(r8.namespace = "demo")
Point <- new_struct("Point", fields = list(x = type_double(), y = type_double()))
r8declaration(Point)
#> [1] "{\"$ir\":1,\"namespace\":\"demo\",\"types\":[{\"kind\":\"struct\",\"name\":\"Point\",\"description\":\"\",\"version\":1,\"fields\":[{\"name\":\"x\",\"type\":{\"kind\":\"double\"},\"description\":\"\"},{\"name\":\"y\",\"type\":{\"kind\":\"double\"},\"description\":\"\"}]}]}"
options(op)