[PATCH] Restore read/source-info in support.scm and export it officially from (chicken syntax)

2023-07-03 Thread felix . winkelmann
> Hi all,
>
> I was checking the Salmonella results and it seems a good number of eggs
> are actually relying on chicken.compiler.support#read/source-info and
> therefore break with the current master:
> http://salmonella-linux-x86.call-cc.org/master/clang/linux/x86/2023/06/28/yesterday-diff/
>
> The attached patch restores the procedure in support.scm, but keeps the
> implementation itself in chicken.syntax, where it makes more sense.
> Since these eggs are using it, that TODO above ##sys#read/source-info
> is settled - it's useful enough for those eggs, so let's just expose
> it publically and document it.
>

Thanks, pushed.


felix




Re: [PATCH] Restore read/source-info in support.scm and export it officially from (chicken syntax)

2023-07-02 Thread Evan Hanson
Hi there,

On 2023-06-30  9:11, Peter Bex wrote:
> Since these eggs are using it, that TODO above ##sys#read/source-info
> is settled - it's useful enough for those eggs, so let's just expose
> it publically and document it.

I wouldn't read too much into those eggs -- most of those are mine, and
they're mostly (all?) failing because read/source-info was used in
module-declarations, which is a dependency of the whole lot. So, many of
those failures only represent a single use of that procedure.

That's not to say we shouldn't still expose it -- probably we should? --
I just wanted to point this out so I'm not inflating the statistics. :)

Evan



[PATCH] Restore read/source-info in support.scm and export it officially from (chicken syntax)

2023-06-30 Thread Peter Bex
Hi all,

I was checking the Salmonella results and it seems a good number of eggs
are actually relying on chicken.compiler.support#read/source-info and
therefore break with the current master:
http://salmonella-linux-x86.call-cc.org/master/clang/linux/x86/2023/06/28/yesterday-diff/

The attached patch restores the procedure in support.scm, but keeps the
implementation itself in chicken.syntax, where it makes more sense.
Since these eggs are using it, that TODO above ##sys#read/source-info
is settled - it's useful enough for those eggs, so let's just expose
it publically and document it.

I noticed there's also an error in the "trace" egg.  This probably has
something to do with the changes in the call chain.  Not sure how, but
I'll investigate.

Cheers,
Peter
From ed691a470bd45bf1ecb9a8d8f53fdfbe4d8c952a Mon Sep 17 00:00:00 2001
From: Peter Bex 
Date: Fri, 30 Jun 2023 09:01:36 +0200
Subject: [PATCH] Restore read/source-info in support.scm and export from
 (chicken syntax)

It turns out several eggs got broken by dropping
chicken.compiler.support#read/source-info because they are using it
directly, even though it's undocumented and supposed to be "internal".

So, restore it in support.scm as an alias for the one in
(chicken syntax) to fix those eggs, but mark it as deprecated.

Since several eggs make use of it, that settles the question of
whether it is useful to export it from (chicken syntax), so do this.
Also, since it's now an official API, make it safe to use by checking
the argument for being a port, and make the argument optional, like in
the regular (read) procedure.
---
 DEPRECATED |  5 +
 NEWS   |  4 
 batch-driver.scm   |  4 +++-
 chicken.syntax.import.scm  |  1 +
 csi.scm|  7 ---
 eval.scm   | 13 -
 expand.scm |  5 +++--
 manual/Module (chicken syntax) | 12 
 repl.scm   |  7 ---
 rules.make |  1 +
 support.scm|  6 +-
 types.db   |  5 +
 12 files changed, 55 insertions(+), 15 deletions(-)

diff --git a/DEPRECATED b/DEPRECATED
index 7d9cffe7..6315e591 100644
--- a/DEPRECATED
+++ b/DEPRECATED
@@ -1,6 +1,11 @@
 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.
+
 5.2.1
 - current-milliseconds and its C implementations C_milliseconds and
   C_a_i_current_milliseconds have been deprecated in favor of
diff --git a/NEWS b/NEWS
index 023d8939..68940ef5 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,10 @@
 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
+using it from there is deprecated.
 
 - Tools
   - The -R option for csi and csc now accepts list-notation like
diff --git a/batch-driver.scm b/batch-driver.scm
index ee7ae28a..f0a5fc08 100644
--- a/batch-driver.scm
+++ b/batch-driver.scm
@@ -47,6 +47,7 @@
chicken.pretty-print
chicken.process-context
chicken.string
+   chicken.syntax
 chicken.port
chicken.time
 chicken.condition
@@ -608,7 +609,8 @@
   (in (check-and-open-input-file f)) )
  (fluid-let ((##sys#current-source-filename f))
(let loop ()
- (let ((x (##sys#read/source-info in)))
+ (let ((x (chicken.syntax#read/source-info in))) ; 
OBSOLETE - after bootstrapping we can get rid of this explicit namespacing
+
(cond ((eof-object? x) 
   (close-checked-input-file in f) )
  (else
diff --git a/chicken.syntax.import.scm b/chicken.syntax.import.scm
index 7ce92fea..0aa5b36d 100644
--- a/chicken.syntax.import.scm
+++ b/chicken.syntax.import.scm
@@ -32,6 +32,7 @@
  'expand
  '((expand . chicken.syntax#expand)
(get-line-number . chicken.syntax#get-line-number)
+   (read/source-info . chicken.syntax#read/source-info)
(strip-syntax . chicken.syntax#strip-syntax)
(syntax-error . chicken.syntax#syntax-error)
(er-macro-transformer . chicken.syntax#er-macro-transformer)
diff --git a/csi.scm b/csi.scm
index fca1da4e..28ab16a0 100644
--- a/csi.scm
+++ b/csi.scm
@@ -280,7 +280,7 @@ EOF
 (define default-evaluator
   (let ((eval eval)
(load-noisily load-noisily)
-   (read (lambda () (##sys#read/source-info (current-input-port
+   (read (lambda ()