Example Lambda defmacro 001
|
In this example, we demonstrate how macros can be used to reduce
complex expressions to simpler forms at compile time.
Notes and Hints In the language of compilers, the plus macro performs constant folding.
(defmacro plus(x y)
(if (or (isSymbol x) (isSymbol y))
(list |+|: x y)
(+ x y)))
Returns:
Returns:
Returns:
Returns:
Here are examples of the defmacro function at work.
Lambda defmacro 001 | Lambda defmacro 002 |
Here is the link to the current function used in this example.
Here are a number of links to other related functions.
setq(#void) | set(#void) | lambda(#void) | defmacro(#void) |
defun(#void) | defriend(#void) | defchild(#void) | list(#void) |
morph(#void) | compile(#void) | deforphan(#void) | defmethod(#void) |
Here are the links to the data types of the arguments used in this example. Here are a number of links to examples having similar argument types.
Lambda
Symbol
Analytic Information Server (AIS)AIS Component Systems
|