summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-01-11 18:30:13 +0100
committerLudovic Courtès <ludo@gnu.org>2010-01-11 18:31:02 +0100
commit411313403cac04d1b1b1c7f579da32eaaaf4d80d (patch)
tree0a3be5c9c6014864dcac4f418b94a04518a95a25
parent628ddb80aa5b33185e7eff81e72d158936079d91 (diff)
downloadguile-411313403cac04d1b1b1c7f579da32eaaaf4d80d.tar.gz
Evaluate the `export' and `re-export' forms at compile-time.
* module/ice-9/boot-9.scm (export, re-export): Evaluate at compile-time in addition to load/eval. * test-suite/tests/tree-il.test ("warnings")["unused-toplevel"]("unused but define-public"): Remove throw to `unresolved'.
-rw-r--r--module/ice-9/boot-9.scm16
-rw-r--r--test-suite/tests/tree-il.test4
2 files changed, 9 insertions, 11 deletions
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index a32e2b64f..af09be82b 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -1,6 +1,6 @@
;;; -*- mode: scheme; coding: utf-8; -*-
-;;;; Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009
+;;;; Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010
;;;; Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
@@ -3119,14 +3119,16 @@ module '(ice-9 q) '(make-q q-length))}."
names)))
(defmacro export names
- `(call-with-deferred-observers
- (lambda ()
- (module-export! (current-module) ',names))))
+ `(eval-when (eval load compile)
+ (call-with-deferred-observers
+ (lambda ()
+ (module-export! (current-module) ',names)))))
(defmacro re-export names
- `(call-with-deferred-observers
- (lambda ()
- (module-re-export! (current-module) ',names))))
+ `(eval-when (eval load compile)
+ (call-with-deferred-observers
+ (lambda ()
+ (module-re-export! (current-module) ',names)))))
(defmacro export-syntax names
`(export ,@names))
diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test
index fb875ccd2..539540c6d 100644
--- a/test-suite/tests/tree-il.test
+++ b/test-suite/tests/tree-il.test
@@ -661,10 +661,6 @@
#:opts %opts-w-unused-toplevel))))))
(pass-if "unused but define-public"
- ;; FIXME: We don't handle this case for now because `define-public'
- ;; expands to a relatively complex statement that's hard to match.
- (throw 'unresolved)
-
(null? (call-with-warnings
(lambda ()
(compile '(define-public foo 2)