~ chicken-core (chicken-5) 7c341016a80dd57b8b739680f22e1a420d2bac99
commit 7c341016a80dd57b8b739680f22e1a420d2bac99
Author: Evan Hanson <evhan@foldling.org>
AuthorDate: Tue Apr 5 21:15:49 2016 +1200
Commit: Evan Hanson <evhan@foldling.org>
CommitDate: Tue Apr 5 21:20:15 2016 +1200
Make read-marks table a qualified global in library.scm
This is necessary so that both library.scm and the read-syntax units can
access it (for `read` and `set-read-syntax!`, respectively).
diff --git a/library.scm b/library.scm
index 463c1721..e0b3004c 100644
--- a/library.scm
+++ b/library.scm
@@ -3711,7 +3711,7 @@ EOF
[(member tok '("optional" "rest" "key"))
(build-symbol (##sys#string-append "#!" tok)) ]
[else
- (let ((a (assq (string->symbol tok) read-marks)))
+ (let ((a (assq (string->symbol tok) ##sys#read-marks)))
(if a
((##sys#slot a 1) port)
(##sys#read-error
@@ -3813,6 +3813,15 @@ EOF
(else (##sys#read-error port "invalid sharp-sign read syntax" char) ) ) )
+;;; Table for specially-handled read-syntax:
+;
+; - entries should be #f or a 256-element vector containing procedures
+; - each procedure is called with two arguments, a char (peeked) and a
+; port, and should return an expression
+
+(define ##sys#read-marks '()) ; TODO move to read-syntax module
+
+
;;; Output:
(define (##sys#write-char-0 c p)
diff --git a/read-syntax.scm b/read-syntax.scm
index ced82d2d..e4575714 100644
--- a/read-syntax.scm
+++ b/read-syntax.scm
@@ -36,19 +36,11 @@
(include "common-declarations.scm")
-;;; Table for specially-handled read-syntax:
-;
-; - entries should be #f or a 256-element vector containing procedures
-; - each procedure is called with two arguments, a char (peeked) and a
-; port, and should return an expression
-
-(define read-marks '())
-
(define (set-read-mark! sym proc)
- (let ((a (assq sym read-marks)))
+ (let ((a (assq sym ##sys#read-marks)))
(if a
(##sys#setslot a 1 proc)
- (set! read-marks (cons (cons sym proc) read-marks)))))
+ (set! ##sys#read-marks (cons (cons sym proc) ##sys#read-marks)))))
(define ((syntax-setter loc slot wrap) chr proc)
(if (symbol? chr)
Trap