From: Pierre R. Mai
Subject: Re: trace-all
Date: 
Message-ID: <87zo4w1hei.fsf@orion.bln.pmsf.de>
Myriam Abramson <········@osf1.gmu.edu> writes:

> Could somebody show me how to do a (trace-all) function or macro? 
> The code below does not work I guess because trace is a macro and
> quotes its argument. 

Maybe a better way would be to say that it doesn't evaluate its
argument.

> (defun trace-all (fns)
>   (dolist (fn fns)
>     (trace fn)))

If you really insist on trace-all being a function, then one way
to apply trace would be to use eval:

(defun trace-all (fns)
  (dolist (fn fns)
    (eval `(trace ,fn))))

Or you could find out what function call trace expands to in your
implementation, and funcall that, but that will not result in portable
code.

That said, trace is already specified to take more than one function
name:

(defun trace-all (fns)
  (eval `(trace ,@fns)))

So the only point in your trace-all function seems to be the ability
to invoke it on arguments that are computed at run-time.  Is that
correct?

Regs, Pierre.

-- 
Pierre R. Mai <····@acm.org>                    http://www.pmsf.de/pmai/
 The most likely way for the world to be destroyed, most experts agree,
 is by accident. That's where we come in; we're computer professionals.
 We cause accidents.                           -- Nathaniel Borenstein