trace, notrace

Gamma: Version 4.0
Prev |  | Next

# `trace, notrace`

`trace`, `notrace` -- turn tracing on or off.

## Syntax

    trace (!code?)
    notrace (!code?)

## Arguments

`code`

  If provided, limits the scope to this code.

## Returns

With no argument, t, or with a `code` argument, the result of evaluating code.

## Description

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.

## Example

        #!/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

Prev | Home | Next
`time` | Up | Miscellaneous

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.