Struct Type

A struct is a container that bundles multiple named values, possibly of different types, into a single value. Each item is retrieved from a struct by name using the matching Extract Struct functor for its type.

A struct's main use is as the output of Calculate Python Expression and Calculate R Expression. An external Python or R script can produce more than one result in a single run, so both functors collect everything the script assigns to dinamica.outputs into one struct, returned through a single result output port. Each named value is then unpacked downstream with the extractor matching its type: Extract Struct Number for a Real Value, Extract Struct String for a String, Extract Struct Table for a Table, Extract Struct Tuple for a Tuple, and Extract Struct Lookup Table for a Lookup Table. Each takes the struct and the item's name, and fails if the struct has no item under that name with that type.

GUI Editor

A struct cannot be edited. As with Map and Categorical Map, its carrier functor's own input is non-editable — a struct can only be produced by connecting the output of another functor, never typed in directly.

EGO Script

Since a struct can't be edited, it also can't be written as a literal in a script. It's always obtained by calling a functor that produces one, and reused by referencing the variable bound to its output:

result := CalculatePythonExpression code;
total := ExtractStructNumber result "total";
label := ExtractStructString result "label";

Automatic Conversions

Structs can't be converted to or from any other type.

See Type System for the complete conversion reference across all types.