Re: Mapping (profile:report-time) over a list of profiled functions?

Drew McDermott <[email protected]>
Newsgroups gmane.lisp.cmucl.general
Message-ID <[email protected]>
> [Pascal Bourguignon]
> We could add that we can of course attain the desired effects by using
> the macro expansion, which in this case is simple:
> 
> (mapcar (lambda (fn-name) (profile::%report-times fn-name))
> 
> But of course we cannot expect it to continue to work with a different
> release of the profiler, since we have the *double* *hint*  "::%" ;-)
> But if there is no report-times* function doing the equivalent of the
> macro, then it's all we can do.

Not quite all, as I'm sure you're aware.  We could also do 

(mapcar (lambda (fn-name) (eval `(profile:report-time ,fn-name)))
        ...)

Using 'eval' is frowned on, but for such ad hoc applications it seems
a harmless way to get around having to know what 'profile:report-time'
expands into.

                                             -- Drew McDermott
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.