[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Tracing (Another NOOB Q)

From: Mario Domenech Goulart
Subject: Re: [Chicken-users] Tracing (Another NOOB Q)
Date: Tue, 01 Nov 2011 13:01:33 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

Hi Erik,

On Tue, 1 Nov 2011 16:47:21 +0000 Erik Falor <address@hidden> wrote:

> On Tue, Nov 01, 2011 at 11:53:51AM -0400, Mario Domenech Goulart wrote:
>> Hi Curtis,
>> Thanks for pointing that out.  The ,tr command has indeed been removed
>> (version 4.3.0).  I've fixed the manual.
> I attempted to create my own ,tr command to wrap the trace/untrace
> function from the trace egg, but I'm stuck on converting a string into
> a procedure name.
> Here's what I have in my .csirc:
> ;; define the ,tr toplevel command to toggle tracing of a function
> (let* ((trace-symbol 'tr)
>        (help-text
>          (string-append
>            ","
>            (symbol->string trace-symbol)
>            " FUNCTION      Toggle tracing of FUNCTION"))
>        (toggle-tracing
>          (lambda ()
>            (let ((function-str (read-line)))
>              (if (= 0 (string-length function-str))
>                (print (string-append "Usage: " help-text))
>                (trace/untrace (string->symbol function-str)))))))
>   (toplevel-command
>     trace-symbol
>     toggle-tracing
>     help-text))
> This fails at the point that I pass a symbol to trace/untrace.  How
> should I convert a string into a procedure's name?  I presume this is
> possible because it is surely what the reader does all day long.

Maybe something like:

  (let* ((trace-symbol 'tr)
         (sprintf ",~a FUNCTION      Toggle tracing of FUNCTION"
           (lambda ()
             (trace/untrace (eval (read))))))

Best wishes.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]