An archetype defines the set of all functions that have a particular input and output specification
in common. By defining an archetype you can create and consume archetype variables that can reference
any particular member of the archetype set. Archetypes are similar to delegates in C# and function prototypes in C++.
Syntax:
(archetype <fully-qualified-namespace>.<archetype-name> <inputs> -> <outputs>) Example: (archetype Sys.OneToOneF32 (Float32 x) -> (Float32 y))
Where fully-qualified-namespace is an existent namespace and archetype-name is a sequence of characters, the first being a capital letter A-Z, and the successors are any alphanumeric character A-Z a-z and 0-9. <inputs> and <outputs> are sequence of s-expressions consisting of types and names that
denote the input and output parameters respectively. Names follow the same rules as all local
identifiers.
An archetype variable is declared and assigned with the syntax:
(<archetype> <local-variable-name> = <function-name>) Example: (archetype Sys.OneToOneF32 (Float32 x) -> (Float32 y)) (Sys.OneToOneF32 f = Sys.Maths.F32.Sin)
The function referenced by the archetype variable is invoked as if the variable name was a function
name:
(archetype Sys.OneToOneF32 (Float32 x) -> (Float32 y)) (Sys.OneToOneF32 f = Sys.Maths.F32.Sin) (Float32 y = (f 0.5)) // has the same effect as (Float32 y = (Sys.Maths.F32.Sin 0.5))