guile-user
[Top][All Lists]
Advanced

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

How can I see output from `trace' when I've `load'ed a file?


From: Eric Hanchrow
Subject: How can I see output from `trace' when I've `load'ed a file?
Date: 28 Nov 2002 12:18:43 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

I'm using guile 1.6.0.

Let's say I have a file named trace.scm with the following content:

--8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<-
    (use-modules (ice-9 debug))

    (define (foo x)
      (cons x '()))

    (trace foo)

    (display (foo 'bob))
    (newline)
--8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<-

Now let's run the file:

    $ guile -s /tmp/trace.scm 
    (bob)

Hmm.  I didn't see any output from `trace'.

Let's try loading the file from the repl:

    $ guile
    guile> (load "/tmp/trace.scm")
    (bob)

That didn't work, either.  Let's try calling the function directly:

    guile> (foo 'bob)
    [foo bob]
    (bob)
    (bob)
    guile> 

Now I see the output.

So: I'd like to be able to see the output even when the file was
"load"ed from the repl, or run with `guile -s'.  Is there a way to do
this?

-- 
PGP Fingerprint: 3E7B A3F3 96CA 8958 ACC5  C8BD 6337 0041 C01C 5276




reply via email to

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