~ chicken-core (chicken-5) 319c5940d3864e704bbfa05e1c8fc03681a656a9


commit 319c5940d3864e704bbfa05e1c8fc03681a656a9
Author:     Peter Bex <peter@more-magic.net>
AuthorDate: Tue Jul 11 15:40:45 2023 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Wed Jul 12 10:12:02 2023 +0200

    Change official name of read/source-info to avoid conflict
    
    Somehow, when using an older compiler to bootstrap, read/source-info
    from support.scm was referencing itself, even though it refers to
    chicken.syntax#read-with-source-info explicitly.  This caused the
    Salmonella test servers to hang.
    
    At some point, we'll have to find out why this happened, but for now
    let's take the easy way out and rename the officially exported name to
    the full name "read-with-source-info".
    
    Signed-off-by: felix <felix@call-with-current-continuation.org>

diff --git a/DEPRECATED b/DEPRECATED
index 6315e591..6c2a009e 100644
--- a/DEPRECATED
+++ b/DEPRECATED
@@ -2,9 +2,9 @@ Deprecated functions and variables
 ==================================
 
 5.3.1
-- read/source-info was moved from the internal, undocumented module
-  (chicken compiler support) into (chicken syntax).  Using it from
-  the former module is deprecated.
+- read/source-info from the internal, undocumented module
+  (chicken compiler support) is deprecated.  Instead, use
+  read-with-source-info from (chicken syntax).
 
 5.2.1
 - current-milliseconds and its C implementations C_milliseconds and
diff --git a/NEWS b/NEWS
index 68940ef5..a371ff8e 100644
--- a/NEWS
+++ b/NEWS
@@ -21,9 +21,9 @@
     filename. Previously, the directory part would be stripped.
   - Added support for embedded strings and characters in SRFI-4 vector
     literals.
-  - read/source-info is now documented and officially supported, from
-    the (chicken syntax) module.  It is still exported from the
-    undocumented internal (chicken compiler support) module, but
+  - read-with-source-info is now documented and officially supported,
+    from the (chicken syntax) module.  read/source-info is still exported
+    from the undocumented internal (chicken compiler support) module, but
     using it from there is deprecated.
 
 - Tools
diff --git a/batch-driver.scm b/batch-driver.scm
index f0a5fc08..8f0a4f35 100644
--- a/batch-driver.scm
+++ b/batch-driver.scm
@@ -609,7 +609,7 @@
 			       (in (check-and-open-input-file f)) )
 			  (fluid-let ((##sys#current-source-filename f))
 			    (let loop ()
-			      (let ((x (chicken.syntax#read/source-info in))) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
+			      (let ((x (chicken.syntax#read-with-source-info in))) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
 
 				(cond ((eof-object? x) 
 				       (close-checked-input-file in f) )
diff --git a/csi.scm b/csi.scm
index 28ab16a0..63ff4221 100644
--- a/csi.scm
+++ b/csi.scm
@@ -280,7 +280,7 @@ EOF
 (define default-evaluator
   (let ((eval eval)
 	(load-noisily load-noisily)
-	(read (lambda () (chicken.syntax#read/source-info (current-input-port)))) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
+	(read (lambda () (chicken.syntax#read-with-source-info (current-input-port)))) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
 	(read-line read-line)
 	(display display)
 	(string-split string-split)
@@ -1047,8 +1047,8 @@ EOF
                  (load home-fn) ) ) ) )
       (define (evalstring str #!optional (rec (lambda _ (void))))
 	(let ((in (open-input-string str))
-	      (read/source-info chicken.syntax#read/source-info)) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
-	  (do ([x (read/source-info in) (read/source-info in)])
+	      (read-with-source-info chicken.syntax#read-with-source-info)) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
+	  (do ([x (read-with-source-info in) (read-with-source-info in)])
 	      ((eof-object? x))
 	    (rec (receive (eval x))) ) ) )
       (when (member* '("-h" "-help" "--help") args)
diff --git a/eval.scm b/eval.scm
index d54be504..929acc38 100644
--- a/eval.scm
+++ b/eval.scm
@@ -1079,7 +1079,7 @@
 			 (##sys#current-load-filename fname)
 			 (##sys#current-source-filename fname))
 	       (let ((in (if fname (open-input-file fname) input))
-		     (read/source-info chicken.syntax#read/source-info)) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
+		     (read-with-source-info chicken.syntax#read-with-source-info)) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
 		 (##sys#dynamic-wind
 		  (lambda () #f)
 		  (lambda ()
@@ -1091,8 +1091,8 @@
 			  "unable to load compiled module - "
 			  (or _dlerror "unknown reason"))
 			 fname)))
-		    (let ((x1 (read/source-info in)))
-		      (do ((x x1 (read/source-info in)))
+		    (let ((x1 (read-with-source-info in)))
+		      (do ((x x1 (read-with-source-info in)))
 			  ((eof-object? x))
 			(when printer (printer x))
 			(##sys#call-with-values
@@ -1169,7 +1169,7 @@
 	(reverse reverse))
     (lambda (filename source k)
       (let ((path (##sys#resolve-include-filename filename #t #f source))
-	    (read/source-info chicken.syntax#read/source-info)) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
+	    (read-with-source-info chicken.syntax#read-with-source-info)) ; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
 	(when (not path)
 	  (##sys#signal-hook #:file-error 'include "cannot open file" filename))
 	(when (load-verbose)
@@ -1177,7 +1177,7 @@
 	(call-with-input-file path
 	  (lambda (in)
 	    (fluid-let ((##sys#current-source-filename path))
-	      (do ((x (read/source-info in) (read/source-info in))
+	      (do ((x (read-with-source-info in) (read-with-source-info in))
 		   (xs '() (cons x xs)))
 		  ((eof-object? x)
 		   (k (reverse xs)))))))))))
diff --git a/expand.scm b/expand.scm
index 5041c665..13a7f553 100644
--- a/expand.scm
+++ b/expand.scm
@@ -37,7 +37,7 @@
 (module chicken.syntax
   (expand
    get-line-number
-   read/source-info
+   read-with-source-info
    strip-syntax
    syntax-error
    er-macro-transformer
@@ -733,7 +733,7 @@
 	   (lp (cdr lst) prev))
 	  (else (lp (cdr lst) lst)))))
 
-(define (read/source-info-hook class data val)
+(define (read-with-source-info-hook class data val)
   (when (and (eq? 'list-info class) (symbol? (car data)))
     (let ((old-value (or (hash-table-ref ##sys#line-number-database (car data)) '())))
       (assq/drop-bwp! (car data) old-value) ;; Hack to clean out garbage values
@@ -747,12 +747,12 @@
 
 (define-constant line-number-database-size 997) ; Copied from core.scm
 
-(define (read/source-info #!optional (in ##sys#standard-input))
+(define (read-with-source-info #!optional (in ##sys#standard-input))
   ;; Initialize line number db on first use
   (unless ##sys#line-number-database
     (set! ##sys#line-number-database (make-vector line-number-database-size '())))
-  (##sys#check-input-port in #t 'read/source-info)
-  (##sys#read in read/source-info-hook) )
+  (##sys#check-input-port in #t 'read-with-source-info)
+  (##sys#read in read-with-source-info-hook) )
 
 
 (define (get-line-number sexp)
diff --git a/manual/Module (chicken syntax) b/manual/Module (chicken syntax)
index 0c3c1e82..d551818c 100644
--- a/manual/Module (chicken syntax)	
+++ b/manual/Module (chicken syntax)	
@@ -356,13 +356,13 @@ identifiers will not have been renamed (most often at toplevel), but
 there may be other contexts in which identifiers ''will'' have been
 renamed.
 
-==== read/source-info
+==== read-with-source-info
 
-<procedure>(read/source-info [port])</procedure>
+<procedure>(read-with-source-info [port])</procedure>
 
 Exactly like {{{read}}} from the {{{scheme}}} module, except it
 registers the expression it read into the line number database, so
-that if {{{(read/source-info)}}} returns {{{OBJ}}},
+that if {{{(read-with-source-info)}}} returns {{{OBJ}}},
 {{{(get-line-number OBJ)}}} will return the line number in {{{port}}}.
 
 The port argument may be omitted, in which case it defaults to the
diff --git a/repl.scm b/repl.scm
index 8bf63d63..d1106930 100644
--- a/repl.scm
+++ b/repl.scm
@@ -152,7 +152,7 @@
 		      (c #f)))))
 		(##sys#read-prompt-hook)
 		;; OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
-		(let ((exp ((or ##sys#repl-read-hook chicken.syntax#read/source-info))))
+		(let ((exp ((or ##sys#repl-read-hook chicken.syntax#read-with-source-info))))
 		  (unless (eof-object? exp)
 		    (when (eq? #\newline (##sys#peek-char-0 ##sys#standard-input))
 		      (##sys#read-char-0 ##sys#standard-input))
diff --git a/support.scm b/support.scm
index 99e66aa9..1e74239a 100644
--- a/support.scm
+++ b/support.scm
@@ -1657,7 +1657,7 @@
 
 ;; DEPRECATED
 (define (read/source-info in)
-  (chicken.syntax#read/source-info in) )
+  (chicken.syntax#read-with-source-info in) )
 
 ;;; "#> ... <#" syntax:
 
diff --git a/types.db b/types.db
index 0e7cb859..b2594112 100644
--- a/types.db
+++ b/types.db
@@ -2359,7 +2359,7 @@
   chicken.syntax#ir-macro-transformer
   ((procedure (* (procedure (*) *) (procedure (* *) *)) *))
   (struct transformer)))
-(chicken.syntax#read/source-info (#(procedure #:enforce) chicken.syntax#read/source-info (#!optional input-port) *))
+(chicken.syntax#read-with-source-info (#(procedure #:enforce) chicken.syntax#read-with-source-info (#!optional input-port) *))
 (chicken.syntax#strip-syntax (#(procedure #:clean) chicken.syntax#strip-syntax (*) *))
 (chicken.syntax#syntax-error (procedure chicken.syntax#syntax-error (* #!rest) noreturn))
 
Trap