wingo pushed a commit to branch wip-whippet
in repository guile.

commit 5565f26314b7ba5defac02251b6f8efbd586b57f
Author: Andy Wingo <wi...@pobox.com>
AuthorDate: Wed Jul 16 11:05:19 2025 +0200

    Fix primitive-load to eval current expression before reading next
    
    * module/ice-9/boot-9.scm (primitive-load): Fix regression.
---
 module/ice-9/boot-9.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index e3aed3afe..faf6ca16c 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -4558,12 +4558,12 @@ R7RS."
             (call-with-input-file file-name
               (lambda (port)
                 (let lp ((expr (read-syntax port)))
-                  (let ((next (read-syntax port)))
-                    (if (eof-object? next)
-                        (primitive-eval expr)
-                        (begin
-                          (primitive-eval expr)
-                          (lp next))))))
+                  (call-with-values (lambda () (primitive-eval expr))
+                    (lambda vals
+                      (let ((next (read-syntax port)))
+                        (if (eof-object? next)
+                            (apply values vals)
+                            (lp next)))))))
               #:encoding "UTF-8" #:guess-encoding #t)))))
 
 

Reply via email to