o42a-0.2.1 Release Notes
This release introduces a macro support.
The macro is an object, which value is an arbitrary expression. This expression can be substituted to the program with a macro expansion unary operator:
#Expression resolved to a macro
The macro field can be declared as any other one, but a shorter syntax is also supported:
#Macro field := expression
When a macro field is overridden, it is re-expanded in the derived object thus rewriting the dependent definitions. This can be used to create generics for example:
Generic :=> void ( #Type :=< void // Type parameter Link :=< (`#type) void ) Integer generic := generic ( Type = integer // Override the type parameter Link = 123 // Integer will be substituted as a new link interface. )
As for now, the macro expansion can only be used as a type parameter. But this limitation will be removed over time to support the macro expansion in (almost?) all places, where arbitrary expressions can be used.