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

Neat! I didn't notice that (even though I am sure that I saw it come up on
the REPL).
It is indeed weird ...
Looks like a time to read some of the source for "(system vm trace)" ...

On Thu, Dec 24, 2020 at 11:58 PM Zelphir Kaltstahl <
zelphirkaltstahl@posteo.de> wrote:

> 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
>
>


  parent reply	other threads:[~2020-12-26  1:23 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 ` trace-calls-to-procedure Zelphir Kaltstahl
2020-12-25  8:42   ` trace-calls-to-procedure tomas
2020-12-26  1:23   ` Tim Meehan [this message]
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=CACgrOx+JHX-Tn3D8qUf0ENQToDmCha1zVYuPSY4JARVVhWaqvg@mail.gmail.com \
    --to=btmeehan@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=zelphirkaltstahl@posteo.de \
    /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).