This is an automated email from the git hooks/post-receive script.

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

The following commit(s) were added to refs/heads/wip-whippet by this push:
     new b96a22d3e primitive-load after boot uses read-syntax
b96a22d3e is described below

commit b96a22d3ea0295c98c2abf5b591742f104818540
Author: Andy Wingo <wi...@pobox.com>
AuthorDate: Thu May 15 22:36:41 2025 +0200

    primitive-load after boot uses read-syntax
    
    * module/ice-9/boot-9.scm (primitive-load): Define a version in Scheme
    that uses read-syntax.  This allows the expander to be able to access
    source locations.
---
 module/ice-9/boot-9.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 101a2755a..d7cef2177 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -4601,7 +4601,22 @@ R7RS."
                       (values read read-syntax)))
   (lambda (read* read-syntax*)
     (set! read read*)
-    (set! read-syntax read-syntax*)))
+    (set! read-syntax read-syntax*)
+
+    (set! primitive-load
+          (lambda (file-name)
+            (when %load-hook
+              (%load-hook file-name))
+            (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))))))
+              #:encoding "UTF-8" #:guess-encoding #t)))))
 
 
 

Reply via email to