trace, notrace
trace, notrace — turn tracing on or off.
trace (!code?)
notrace (!code?)
codeIf provided, limits the scope to this code.
With no argument, t, or
with a code argument, the result of evaluating code.
These functions turn tracing (execution tracking to standard output) on
or off, either at the global level, or for the duration of the evaluation of
code, if provided.
#!/usr/local/bin/gamma -d
/* here is an example of a troublesome function and its
return being debugged with the aid of trace() and
notrace() functions.
*/
a = 0;
b = 1;
trace();
function trouble_function(x,y) {y/x;}
results = trouble_function(a,b);
notrace();
princ(results, "\n");
Gamma generates the following:
(defun trouble_function (x y) (/ y x)) --> trouble_function (trouble_function a b) (/ y x) --> inf --> inf (setq results (trouble_function a b)) --> inf (notrace) inf