guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix for 1.6 psyntax.pp bootstrapping bug.


From: Rob Browning
Subject: Fix for 1.6 psyntax.pp bootstrapping bug.
Date: Mon, 15 Sep 2003 00:23:07 -0500
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

After more investigation, I think I've fixed the bug(s), but please
check this patch if you have time, to be sure I've interpreted things
correctly.

In the case of compile-psyntax.scm, I guessed that the with-fluids
clause was overlooked when similar changes were backported from 1.7 to
1.6.

In the case of syncase.scm, eval was being defined to #f at the start
of the file and then exported.  It looks like this is what was causing
the psyntax.ss (or was it .pp?) load to fail when the code attempted
to call eval:

  <unnamed port>: In expression
  (eval (list syntmp-noexpand-1497 syntmp-x-2446) (interaction-environment)):
  <unnamed port>: Wrong type to apply: #f

As a quick fix, I just moved the (export eval) lower in the file, so
that it's located after the eval (re)definition.  That way no one ever
sees eval bound to #f.

Index: ice-9/compile-psyntax.scm
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/ice-9/compile-psyntax.scm,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 compile-psyntax.scm
--- ice-9/compile-psyntax.scm   4 Sep 2002 20:09:00 -0000       1.1.2.2
+++ ice-9/compile-psyntax.scm   15 Sep 2003 05:10:10 -0000
@@ -12,14 +12,16 @@
 
 (let ((in (open-input-file source))
       (out (open-output-file (string-append target ".tmp"))))
-  (let loop ((x (read in)))
-    (if (eof-object? x)
-       (begin
-         (close-port out)
-         (close-port in))
-       (begin
-         (write (sc-expand3 x 'c '(compile load eval)) out)
-         (newline out)
-         (loop (read in))))))
+  (with-fluids ((expansion-eval-closure
+                (module-eval-closure (current-module))))
+    (let loop ((x (read in)))
+      (if (eof-object? x)
+         (begin
+           (close-port out)
+           (close-port in))
+         (begin
+           (write (sc-expand3 x 'c '(compile load eval)) out)
+           (newline out)
+           (loop (read in)))))))
 
 (system (format #f "mv -f ~s.tmp ~s" target target))
Index: ice-9/syncase.scm
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/ice-9/syncase.scm,v
retrieving revision 1.18.2.8
diff -u -r1.18.2.8 syncase.scm
--- ice-9/syncase.scm   27 Jan 2003 11:02:51 -0000      1.18.2.8
+++ ice-9/syncase.scm   15 Sep 2003 05:10:11 -0000
@@ -61,9 +61,6 @@
 ;; code and include 'eval' in the export clause of define-module,
 ;; above.
 
-(define eval #f)
-(export eval)
-
 
 
 (define expansion-eval-closure (make-fluid))
@@ -255,6 +252,8 @@
                     (cadr x)
                     (sc-expand x))
                 environment))
+
+(export eval)
 
 ;;; Hack to make syncase macros work in the slib module
 (let ((m (nested-ref the-root-module '(app modules ice-9 slib))))

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]