List Info

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




Re: Mapping (profile:report-time) over a list of profiled functions?
country flaguser name
United States
2007-09-29 09:29:40
> [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





[1]

about | contact  Other archives ( Real Estate discussion Medical topics )