geiser-users
[Top][All Lists]
Advanced

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

Re: [Geiser-users] Tracing function calls with guile


From: Jose A. Ortega Ruiz
Subject: Re: [Geiser-users] Tracing function calls with guile
Date: Tue, 02 Jul 2013 14:40:11 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi Ivan,

On Tue, Jul 02 2013, Ivan Sichmann Freitas wrote:

> Hello,
>
> I'm unable to get traces with geiser's guile repl. Consider this
> example:
>
> (define (square x) (* x x))
> (define (fast-expt-iter b n a count)
>   (if (= count n)
>       a
>       (if (< (- n count) 2)
>           (fast-expt-iter b n (* b a) (+ count 1))
>           (fast-expt-iter b n (* a (square b)) (+ count 2)))))
>
> Using ,trace (fast-expt-iter 4 8 1 0) in the repl yields no output, but
> in the standard guile repl it prints execution's trace. In geiser's,
> even using ,option trace #t made no difference.
>
> Am I doing something wrong when tracing or it is tracing not supported
> by guile?

Not sure what you're doing wrong, but it works for me... in a Geiser
REPL i get:

  scheme@(guile-user)> ,trace (fast-expt-iter 4 8 1 0)
  trace: |  (#<procedure 8cc6a50> #(#<directory (guile-user) 87126c0> #f))
  trace: |  #(#<directory (guile-user) 87126c0> fast-expt-iter)
  trace: (#<procedure 8ccc9d0 at <current input>:29:7 ()>)
  trace: (fast-expt-iter 4 8 1 0)
  trace: |  (square 4)
  trace: |  16
  trace: (fast-expt-iter 4 8 16 2)
  trace: |  (square 4)
  trace: |  16
  trace: (fast-expt-iter 4 8 256 4)
  trace: |  (square 4)
  trace: |  16
  trace: (fast-expt-iter 4 8 4096 6)
  trace: |  (square 4)
  trace: |  16
  trace: (fast-expt-iter 4 8 65536 8)
  trace: 65536
  scheme@(guile-user)> 

without modifying any option.  What versions of emacs and guile are you
using?

Cheers,
jao
-- 
Lisp has assisted a number of our most gifted fellow humans in
thinking previously impossible thoughts. —Edsger Dijkstra



reply via email to

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