Type constructors - Manhunter07/MFL GitHub Wiki
Type constructors are comparable to generic types (or type templates) in C++, C# and Delphi. They are however, pre-defined language constructs that have a slightly special syntax.
any([Type1[, ...]])
Specifies a type that accepts any of the argument types. Accepts only type identifiers as arguments.
any(Type1[, Type2[, ...]])
Specifies a type that accepts none of the argument types. Accepts only type identifiers as arguments. If no parameters are set, the resulting type accepts any value.
range(MinValue, MaxValue)
range(MaxValue, MinValue)
Specifies a type that supports a value range of two values passed as constraints. Accepts two values as arguments. If the first argument is greater than the second argument, it is set for the second parameter, thus you can be asured the constraints are normalized.
enum(Value1[, Value2[, ...]])
Specifies type that supports a selection of one or more values. Accepts one or more values as arguments.
integer([Divisor1 = 1[, Divisor 2[, ...]]])
Specifies type that supports numbers that are integer-dividable by a selection of divisors. Accepts only numbers as as arguments. If no parameters are set, the resulting type accepts any integer number.
rangeint(MinValue, MaxValue[, Divisor1 = 1[, Divisor2[, ...]]])
Specifies type that supports a range of two numbers passed as constraints that are integer-dividable by a selection of divisors. Accepts two or more numbers as as arguments. If no divisors are set, the resulting type accepts any integer number within the range.
sizeint(Signed, Size[, Divisor1 = 1[, Divisor2[, ...]]])
Specifies type that supports a positive or mixed range of numbers supported by the byte-size passed as argument. Accepts one boolean and one or more numbers as as arguments. If no divisors are set, the resulting type accepts any integer number representable within the byte count. If the first parameter is set True
, the value range is treated 2-complementary.
string([Length])
string([MinLength, MaxLength])
array([Dimension1[, ...]])
string([FieldName1[, ...]])
object(ParentType1[, ...])
custom(AssertFunction1[, ...])