guile-devel
[Top][All Lists]
Advanced

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

Re: for-each and varargs


From: Mikael Djurfeldt
Subject: Re: for-each and varargs
Date: Mon, 10 Feb 2003 13:43:23 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

Kevin Ryde <address@hidden> writes:

> In the latest cvs built on a recent i386 debian, for-each doesn't
> always seem to like a procedure taking a variable number of arguments.
> For instance foo.scm,
>
>     (for-each (lambda (x . y) (display x))
>               '(1 2 3))
>
> run with "guile -s foo.scm" gives
>
>     ERROR: In procedure for-each:
>     ERROR: Wrong type argument in position 1: #<procedure #f (x . y)>
>
> whereas I hoped it would display `123'.

* eval.c (scm_trampoline_0, scm_trampoline_1, scm_trampoline_2):
Fixed formals tests for closures.  (Thanks to Kevin Ryde.)

Silly me.  I've been a bit careless when implementing this one.

> Curiously this is what it does when run interatively, not with
> "guile -s".

That's because "guile -s" uses the "normal" evaluator by default.
for-each doesn't use an optimized strategy when the debugging
evaluator is active.  This is to get a more informative backtrace.

Best regards,
Mikael D.




reply via email to

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