This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Body of `begin' is not evaluated in left-to-right order?
- From: Kaloian Doganov <kaloian at doganov dot org>
- To: kawa at sourceware dot org
- Date: Sun, 15 Jan 2006 19:54:20 +0200
- Subject: Body of `begin' is not evaluated in left-to-right order?
Hello!
I am new to Kawa and Scheme and I'm going through various tutorials,
trying to learn the language. I've just encountered a behaviour in Kawa
that seems unusual to me. Here is the example:
(define (sleep-example)
(begin (display "before\n") (sleep 3) (display "after\n")))
The obvious goal is to write a procedure that displays a line, then
waits for some time (3 seconds) and displays another line. When I
evaluate `(sleep-example)' in Kawa, it first waits for 3 seconds, and
then prints the both lines immediately one after another. The behaviour
looks just like if the body of `sleep-example' was:
(begin (sleep 3) (display "before\n") (display "after\n")))
The same example evaluated in Guile works as expected - "before" is
displayed at once, then "after" is displayed 3 seconds later. Am I
missing something, or this is bug in Kawa?
I am using Kawa 1.8 and Guile 1.6.7 on a GNU system.