Algosim documentation: ToStructType

ToStructType

Creates a structure type using a given structure as template.

Syntax

Description

ToStructType(S, s) returns a structure type based on S with name s.

Examples

S ≔ struct("FirstName": "", "LastName": "", "Age": 0)
FirstName:
LastName:
Age: 0
TPerson ≔ ToStructType(S, "Person")
FirstName:
LastName:
Age: 0
Albus ≔ new(TPerson, "FirstName": "Albus", "LastName": "Dumbledore", "Age": 110)
FirstName: Albus
LastName: Dumbledore
Age: 110
'(S, TPerson, Albus) @ type
structure
structure type
structure of type "Person"