summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-11-11 20:41:29 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-11-11 20:41:29 +0100
commit3e86f68fb89870a7ee716eb4c90903bff7f1cea3 (patch)
treec7437f5d5ee045ba3211bc95264aeb6ad915bab4
parent7c7c335386134bc1e45cf62fc2755173facc40cc (diff)
downloadmew-3e86f68fb89870a7ee716eb4c90903bff7f1cea3.tar.gz
mew-3e86f68fb89870a7ee716eb4c90903bff7f1cea3.tar.xz
mew-3e86f68fb89870a7ee716eb4c90903bff7f1cea3.zip
allow def in while/until
-rw-r--r--mew.scm2
-rw-r--r--tests/test.mew6
2 files changed, 7 insertions, 1 deletions
diff --git a/mew.scm b/mew.scm
index 6ae2e6d..92197b3 100644
--- a/mew.scm
+++ b/mew.scm
@@ -263,7 +263,7 @@
       ((_ cond body ...)
        (let loop ((c cond))
          (if c
-           (begin
+           (let ()
              body ...
              (loop cond)))))))
 
diff --git a/tests/test.mew b/tests/test.mew
index 98ad5fa..904127d 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -234,6 +234,12 @@
               (while (> y 0)
                 (set x (+ x y))
                 (set y (dec y)))
+              x))
+  (test 42 (loc (x 27 y 5)
+              (while (> y 0)
+                (def z (+ x y))
+                (set x z)
+                (set y (dec y)))
               x)))
 
 (test-group "until"