Open MarcosCosmos opened 7 years ago
Yeah, macros would be very nice, I'm guessing we could implement it with these commands (feel free to suggest new names):
#DEFMACRO <NAME> <A> <B> <C> …
to start a macro definition with this name and these arguments#ENDMACRO
to end a macro definition#CALL <NAME> <A> <B> <C> …
to call a macro with this name and these args#SET <VAR> <VAL>
to set a variable to a valueThis plus when reading the argument list, if a '$' is found as the first character, assume it's a variable and replace.
For now, no nested macros.
Just simple (static) regex-replace c-style macros to /allow/ complex shapes to be drawn simply.
This would mainly be useful for allowing us to do something like share any more complex shapes we might want (e.g. map bounds) between each other as downloadables without having to muck around too much.
This aligns well with #8 if we turn meta-data into variable settting e.g. #CALL WIZARD $y $y.
macros and variables should be strictly single layer only for the case of enforcing simplicity, so no nesting (can't macro a macro or reference another variable).