Various type specification
Some Genero APIs use variant types for parameters or returns.
In Genero BDL, we distinguish different kind of types:
- Primitive data types, such as
INTEGER
,VARCHAR(50)
. - Structured types, defined with
RECORD
(with or without associated methods). - Array types (
DYNAMIC ARRAY OF ...
). - Dictionary types (
DICTIONARY OF ...
). - Function reference types, defined with
TYPE + FUNCTION
. - Interface types, defined with
TYPE + INTERFACE
.
Some built-in function or methods of built-in classes or extension classes can take various sort of types as parameter, or return various types of values.
For example, the util.JSON.stringify()
method can take a simple primitive data type value, a
structured record, or an array as parameter, and convert that to its corresponding JSON string.
When a Genero API accepts such various type specification as parameter or return value, the
syntax diagram will mention this as
"
any-type
":util.JSON.stringify(
value any-type
)
RETURNS STRING