mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
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.
This commit is contained in:
parent
ddef73d03f
commit
b96a22d3ea
1 changed files with 16 additions and 1 deletions
|
@ -4601,7 +4601,22 @@ R7RS."
|
||||||
(values read read-syntax)))
|
(values read read-syntax)))
|
||||||
(lambda (read* read-syntax*)
|
(lambda (read* read-syntax*)
|
||||||
(set! read read*)
|
(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)))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue