defmacro
defmacro(s_macroName(l_formalArglist)g_expr1... ) =>s_macroName
Description
Defines a macro which can take a list of formal arguments including @optional, @key, and @rest (instead of the more restrictive format as required by using mprocedure).
The arguments will be matched against the formals before evaluating the body.
Arguments
Value Returned
Examples
defmacro( whenNot (cond @rest body)
‘(if ! ,cond then ,@body) )
=> whenNot
expandMacro( '(whenNot x > y z = f(y) x*z) )
=> if(!(x > y) then (z = (f y))(x * z))
whenNot(1 > 2 "hello" 1+2)
=> 3
Related Topics
Function and Program Structure
Return to top