guile-user
[Top][All Lists]
Advanced

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

Re: Macro expansion


From: Neil Jerram
Subject: Re: Macro expansion
Date: Sat, 15 Jan 2011 20:39:16 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hans Aberg <address@hidden> writes:

> In the code below the 'loop' and 'begin' examples will execute the
> while' loop, but if put into the body of a function, 'while' will not
> run. So why, and how to fix it?
>
> Just copy and paste the examples below into guile. For the two first,
> I get
>   0123456789
>   0123456789done!3
> but for the third, the thunk, only
>   done!3

With my current Guile,

scheme@(guile-user)> (version)
$4 = "1.9.14.17-44f43"

the third case behaves as you would expect:

scheme@(guile-user)> ((lambda
  ()
  (begin
    (loop ((define i 0))
         (< i 10)
         ((set! i (+ i 1)))
         ((display i)))
    (display "done!")
    (+ 1 2)
  )
))
0123456789done!$5 = 3

Regards,
        Neil



reply via email to

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