[Top][All Lists]

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

Re: trace-calls-to-procedure

From: Zelphir Kaltstahl
Subject: Re: trace-calls-to-procedure
Date: Fri, 25 Dec 2020 06:58:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi Tim!

I do not know the answer to your question, but I noticed something else:
trace-calls-to-procedure returns a procedure. That procedure and its
return value can be applied infinitely, it seems:

scheme@(guile-user)> (import (system vm trace))
scheme@(guile-user)> (define (sqr x)
    (* x x))
scheme@(guile-user)> (trace-calls-to-procedure sqr)
$1 = #<procedure 7f25860f4e80 at system/vm/traps.scm:599:6 (#:optional frame)>
scheme@(guile-user)> ((trace-calls-to-procedure sqr) 9)
$2 = #<procedure 7f25861ac1c0 at system/vm/traps.scm:596:8 (#:optional frame)>
scheme@(guile-user)> (((trace-calls-to-procedure sqr) 9))
$3 = #<procedure 7f2586624660 at system/vm/traps.scm:599:6 (#:optional frame)>
scheme@(guile-user)> ((((trace-calls-to-procedure sqr) 9)))
$4 = #<procedure 7f25861e9280 at system/vm/traps.scm:596:8 (#:optional frame)>

Not sure if that helps :D


On 12/25/20 5:51 AM, Tim Meehan wrote:
> I have used ",trace" before and get what it is supposed to do, but I am not
> sure what "trace-calls-to-procedure" is supposed to do ...
> ;; Using Guile 3.0.4
> (use-modules (system vm trace))
> (define (sqr x)
>     (* x x))
> (trace-calls-to-procedure sqr)
> (sqr 3)
> ;; ... and nothing happens ... is something supposed to happen?


reply via email to

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