$SPAD/src/input macbug.input

Timothy Daly December 3, 2016

Abstract

Contents

2

1 License

— license —

--Copyright The Numerical Algorithms Group Limited 1991.

———-

— * —

)set break resume
)spool macbug.output
)set message test on
)set message auto off
)clear all

———-

Macros can be parameterized and so can be used for many different kinds of objects. — * —

--S 1 of 5
macro ff(x) == x**2 + 1
--R
--R                                                                   Type: Void
--E 1

———-

Apply it to a number, a symbol, or an expression.

— * —

--S 2 of 5
ff z
--R
--R
--R         2
--R   (2)  z  + 1
--R                                                    Type: Polynomial(Integer)
--E 2

———-

Macros can also be nested, but you will get an error message if you run out of space because of an infinite nesting loop.

— * —

--S 3 of 5
macro gg(x) == ff(2*x - 2/3)
--R

--R                                                                   Type: Void
--E 3

———-

This new macro is fine as it does not produce a loop.

— * —

--S 4 of 5
gg(1/w)
--R
--R
--R           2
--R        13w  - 24w + 36
--R   (4)  ---------------
--R                2
--R              9w
--R                                          Type: Fraction(Polynomial(Integer))
--E 4

———-

This however will loop since gg is defined in terms of ff. We risk not using a free g on next line

— * —

--S 5 of 5
macro ff(x) == gg(-x)
--R
--R                                                                   Type: Void
--E 5
)spool
)lisp (bye)

———-

References^{[1] nothing}

5