unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
To: btmeehan@gmail.com
Cc: guile-user@gnu.org
Subject: Re: trace-calls-to-procedure
Date: Fri, 25 Dec 2020 06:58:00 +0100	[thread overview]
Message-ID: <3c36067b-5247-03a0-ab64-b4241a8fea30@posteo.de> (raw)
In-Reply-To: <CACgrOx+yX6M0oYcVTwu9rKV-M9153v6tWb33SpECX0phFuk+Mw@mail.gmail.com>

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)>
scheme@(guile-user)> 
~~~~

Not sure if that helps :D

Regards,
Zelphir

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?

-- 
repositories: https://notabug.org/ZelphirKaltstahl



  reply	other threads:[~2020-12-25  5:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-25  4:51 trace-calls-to-procedure Tim Meehan
2020-12-25  5:58 ` Zelphir Kaltstahl [this message]
2020-12-25  8:42   ` trace-calls-to-procedure tomas
2020-12-26  1:23   ` trace-calls-to-procedure Tim Meehan
2020-12-25 12:37 ` trace-calls-to-procedure Tim Van den Langenbergh
2020-12-25 14:56   ` trace-calls-to-procedure Tim Van den Langenbergh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3c36067b-5247-03a0-ab64-b4241a8fea30@posteo.de \
    --to=zelphirkaltstahl@posteo.de \
    --cc=btmeehan@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).