]>
A macro provides general textual substitution of macro an Axiom expression for a name. You can think of a macro as being a generalized abbreviation. You can only have one macro in your workspace with a given name, no matter how many arguments it has.
The two general forms for macros are
macro name == body
macro name(arg1,...) == body
where the body of the macro can be any Axiom expression.
For example, suppose you decided that you like to use df for D. You define the macro df like this.
Whenever you type df, the system expands it to D.
Macros can be parameterized and so can be used for many different kinds of objects.
Apply it to a number, a symbol, or an expression.
Macros can also be nested, but you get an error message if you run out of space because of an infinite nesting loop.
This new macro is fine as it does not produce a loop.
This, however, loops since gg is defined in terms of ff.
The body of a macro can be a block.
Before entering next, we need values for present and future.
Repeatedly evaluating next produces the next Fibonacci number.
And the next one.
Here is the infinite stream of the rest of the Fibonacci numbers.
Bundle all the above lines into a single macro.
Use concatconcatStream to start with the first two Fibonacci numbers Fibonacci numbers.
The library operation fibonacci is an easier way to compute these numbers.