Skip to content

DeclareType ​

Generated from the engine's own definition: compute-engine's symbol, which we neither extend nor document by hand. No examples yet — the crosswalk is the reason it has a page.

Declare a type. Types are engine-global (not lexically scoped), so this is only valid at the top level of a program — inside a block or function body it is an error. The name is a symbol (or a string) and the type a string holding a type expression, e.g. "tuple<x: integer, y: integer>". The type is nominal by default; an optional trailing attributes dictionary with alias -> True makes it a structural alias instead, and an additional typeParams -> "T, U: number" entry makes it a GENERIC alias whose uses must be applied (Pair<integer>). The declaration also mints a value constructor of the same name — ["point", 1, 2], an inert tagged value for a nominal type, a checked identity for an alias — except for a record body, which mints none. Evaluates to Nothing.

DeclareType(string | symbol, type: string | symbol | type, attributes: dictionary<any>?) scope -> nothingas compute-engine declares it
Typed signatures
TypePackageApplies
(string | symbol, type: string | symbol | type, attributes: dictionary<any>?) scope -> nothingcompute-enginealways

Domain: Compute engine

About