Hi all,

Here's an updated version of the simple patch I wrote earlier for #1077.
It's the lowest-hanging fruit on the path towards fixing that bug.  This
patch simply removes the ugly "private-namespace" hack from the csi
program, as it doesn't need that at all.  We could make csi a module,
but I don't really see the point right now: just hiding the private
variables should be enough for now.  Later, we can determine what csi
should be exporting, if anything, and convert it into a proper module.
This should make eggs that hook into csi easier to write, if there's
an "official" API, but like I said, that's for later.

The extras unit also has the private-namespace listed as a compile-time
dependency but doesn't include it, so I've simply removed the dependency.
The srfi-69 unit gets extended with the private-namespace for no
apparent reason, so I've removed that as well.

This doesn't fix #1077 yet: for that we'd need to convert the compiler
to use the module system, as Felix proposed before, and then we'll need
to rip out the special handling for qualified symbols (best to do the
latter after making a dev snapshot, so we have something to bootstrap
from).  I will attempt to do that as well, but the csi patch is so
simple I think we can just push it without any trouble.

Cheers,
Peter
-- 
http://www.more-magic.net
>From 82ae7a211a9258b66c8b500a4ef8882c40fdab5c Mon Sep 17 00:00:00 2001
From: Peter Bex <peter....@xs4all.nl>
Date: Sat, 26 Jul 2014 14:30:50 +0200
Subject: [PATCH] Do not use a private namespace for the "csi" program.

This is unnecessary as it does not share hidden variables with any
other separately compiled unit.

This also removes the (unused) private-namespace dependency from the
extras and srfi-69 units.
---
 csi.scm    |   15 +++++----------
 rules.make |    8 ++++----
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/csi.scm b/csi.scm
index fd7b165..0922605 100644
--- a/csi.scm
+++ b/csi.scm
@@ -43,21 +43,16 @@ EOF
 
 (include "banner")
 
-(private csi 
-  print-usage print-banner
-  run hexdump
-  parse-option-string chop-separator lookup-script-file
-  report describe dump hexdump bytevector-data get-config
-  tty-input?
-  history-list history-count history-add history-ref history-clear 
history-show)
-
 (declare
   (always-bound
     ##sys#windows-platform)
-  (hide parse-option-string bytevector-data member* canonicalize-args 
+  (hide parse-option-string bytevector-data member* canonicalize-args
        describer-table dirseparator? circular-list? improper-pairs?
        show-frameinfo selected-frame select-frame copy-from-frame
-       findall command-table default-editor csi-eval) )
+       findall command-table default-editor csi-eval csi print-usage
+       print-banner run hexdump chop-separator lookup-script-file report
+       describe dump get-config tty-input? history-list history-count
+       history-add history-ref history-clear history-show) )
 
 
 ;;; Parameters:
diff --git a/rules.make b/rules.make
index d405f5c..4269980 100644
--- a/rules.make
+++ b/rules.make
@@ -506,14 +506,14 @@ expand.c: $(SRCDIR)expand.scm $(SRCDIR)synrules.scm 
$(SRCDIR)common-declarations
        $(bootstrap-lib)
 modules.c: $(SRCDIR)modules.scm $(SRCDIR)common-declarations.scm
        $(bootstrap-lib)
-extras.c: $(SRCDIR)extras.scm $(SRCDIR)private-namespace.scm 
$(SRCDIR)common-declarations.scm
+extras.c: $(SRCDIR)extras.scm $(SRCDIR)common-declarations.scm
        $(bootstrap-lib)
 posixunix.c: $(SRCDIR)posixunix.scm $(SRCDIR)posix-common.scm 
$(SRCDIR)common-declarations.scm
        $(bootstrap-lib) 
 posixwin.c: $(SRCDIR)posixwin.scm $(SRCDIR)posix-common.scm 
$(SRCDIR)common-declarations.scm
        $(bootstrap-lib) 
 srfi-69.c: $(SRCDIR)srfi-69.scm $(SRCDIR)common-declarations.scm
-       $(bootstrap-lib) -extend $(SRCDIR)private-namespace.scm
+       $(bootstrap-lib)
 irregex.c: $(SRCDIR)irregex.scm $(SRCDIR)irregex-core.scm 
$(SRCDIR)irregex-utils.scm $(SRCDIR)common-declarations.scm
        $(bootstrap-lib)
 #
@@ -574,8 +574,8 @@ endef
 $(foreach obj, $(COMPILER_OBJECTS_1),\
           $(eval $(call declare-bootstrap-compiler-object,$(obj))))
 
-csi.c: $(SRCDIR)csi.scm $(SRCDIR)banner.scm $(SRCDIR)private-namespace.scm
-       $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ -extend 
$(SRCDIR)private-namespace.scm
+csi.c: $(SRCDIR)csi.scm $(SRCDIR)banner.scm
+       $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
 chicken-profile.c: $(SRCDIR)chicken-profile.scm
        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ 
 chicken-install.c: $(SRCDIR)chicken-install.scm setup-download.c setup-api.c
-- 
1.7.10.4

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to