Hi Thorsten, > but it would be nice to have a function pair (log and unlog) that does > all this: > > - trace the function > - redirect the output of trace to a file too > - untrace and go back to default stderr > > something like this > > #+begin_src picolisp > (de log (Func) > (err (tmp "log") > (trace Func) > (pass Func) ) ) > #+end_src > > but this does not work unfortunately...
How about this? (de log (File Funs . Prg) (err File (prog2 (mapc trace Funs) (run Prg 1) (mapc untrace Funs) ) ) ) It can be used like (log "+myLogFile" '(gt0 le0 + - * /) (myProgram (myFun (foo (bar ..)) ) ) ) This example traces all calls to the comparison and arithmetic functions in the list while 'myProgram' is running. The "+" is to append the output to the log file. Without it, "myLogFile" will be overwritten from scratch each time. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe