Hello,

It seems the current Guile does not do properly tail-call
when a procedure is called through map.

  % guile -q
  guile> (define (foo x) x)
  guile> (define (bar x) (foo x))

Now `bar' should tail-call `foo`.

  guile> (trace foo bar)
  (foo bar)
  guile> (bar 1)
  [bar 1]
  [foo 1]
  1
  1

This is okay.  However,

  guile> (define (baz) (map bar '(1 2)))
  guile> (trace baz)
  (baz)
  guile> (baz)
  [baz]
  |  [bar 1]
  |  |  [foo 1]
  |  |  1
  |  1
  |  [bar 2]
  |  |  [foo 2]
  |  |  2
  |  2
  (1 2)
  (1 2)

This time `foo' is creating a new frame.  Is this correct?

Thanks,
Keisuke Nishida

_______________________________________________
Bug-guile mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-guile

Reply via email to