A Micro declares an untyped constant value. An expession is declared that is evaluated into a constant value. Micros can be declared Local within procedures, Global within a class, or as a field within a structure.
A reference to the Micro name substitutes the resulting constant value in an expression. It's type is then determined within the context of the expression where it is used. Additionally Micro expressions can contain references to other Micros.
Operators in a Micro expression can either be strings or integers. Real numeric operators are not permitted. Real constants can only be singularly assigned to a Micro.
Micro |= <Real.Number> local Pi |= 3.14159, &Valid real Micro value. Pi2 |= 3.14159 * 2 :Real number operations are not allowed.
Quoted text can be interpreted either as a string or an integer value. Consider the case where a Micro is simply assigned to a quoted value.
Micro |= <Quote> local Term |= '.', Join |= "and", S string, I byte S = Term; S is "." S = Join; S is "and" I = Term; I is '.' = 46 I = Join; I is 'a' = 97
When using a numeric value in a Micro it's type is not determined until it is referenced in an expression. However if a Micro is assigned to an expression using operators or functions, the type of the operator or function needs to be determined. We know the operands of an append operator ('!') are strings. When the type of a numeric operator is unknown then a Cell type is used implicitly.
Micro |= <Expression> local Star |= '*', Text |= Star ! "Name", &string{ "*" ! "Name" } = "*Name" Lead |= left( Text, 2 ), &left( string{ "*Name" }, 2 ) = "*N" Flag |= Star + 256, &cell{ '*' + 128 } = 170 Item |= byte{ Flag } :cell{ byte{ Flag }} = -86
Declaration_Statement
Declare Macro
![]()