[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tail-call bug with map?
From: |
Michael Livshin |
Subject: |
Re: tail-call bug with map? |
Date: |
16 Oct 2000 09:46:19 +0200 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (20 Minutes to Nikko) |
Keisuke Nishida <address@hidden> writes:
> It seems the current Guile does not do properly tail-call
> when a procedure is called through map.
I may be wrong, as I'm very out of practice wrt reading the Guile
evaluator code (ouch), but here is what happens:
`map' is implemented as a primitive, so it calls `scm_apply', which in
turn makes a _fresh_ call to the debugging evaluator (because `bar' is
traced). the first procedure call in a fresh evaluator is always
shown as non-tail. this is because the tailness of the current call
is determined by the ENTER_APPLY macro by looking whether the current
frame is traced. right after this check, the very same macro marks
the current frame as traced, so naturally the very _first_ frame is
never marked in time. I don't know if this is a bug or not, we should
ask Mikael (where are you, Mikael?).
so, anyway, what you see is an artifact of the debugging evaluator,
the calls themselves are still tail-calls.
--
You have a tendency to feel you are superior to most computers.