Macros
Macros are another way way for the user to encapsulate activity code and refer to it. Like Subroutines, macros may be called uising a function-call like syntax, yet unlike subroutines, macros are not implemented as single chunks of code. Each call to a macro literally duplicates the macro definition in the code, replacing the macro's arguments with the exact test of what was passed.
Also unlike subroutines, macros have arguments. Yet the arguments to macros are not themselves variables, but placeholders for text that will be substituted in the macro call.Format:
defmacro [name]( [argument], [argument], ... ) { [statements] }
Examples
defmacro do_twice(stmt) {
stmt
stmt
}
defmacro alert_with_time(message_string) {
alert(concat(datestring("G:i:s ", now()), message_string)
}