#`(#:filename 'f . #,(parse #'args imp exp rex rep aut)))
((#:use-module (name name* ...) . args)
(and (and-map symbol? (syntax->datum #'(name name* ...))))
- (parse #'args (cons #'((name name* ...)) imp) exp rex rep aut))
+ (parse #'args #`(#,@imp ((name name* ...))) exp rex rep aut))
((#:use-syntax (name name* ...) . args)
(and (and-map symbol? (syntax->datum #'(name name* ...))))
#`(#:transformer '(name name* ...)
- . #,(parse #'args (cons #'((name name* ...)) imp) exp rex rep aut)))
+ . #,(parse #'args #`(#,@imp ((name name* ...))) exp rex rep aut)))
((#:use-module ((name name* ...) arg ...) . args)
(and (and-map symbol? (syntax->datum #'(name name* ...))))
(parse #'args
- (cons #`((name name* ...) #,@(parse-iface #'(arg ...))) imp)
+ #`(#,@imp ((name name* ...) #,@(parse-iface #'(arg ...))))
exp rex rep aut))
((#:export (ex ...) . args)
(parse #'args imp #`(#,@exp ex ...) rex rep aut))
check_SCRIPTS += test-guile-snarf
TESTS += test-guile-snarf
+check_SCRIPTS += test-import-order
+TESTS += test-import-order
+EXTRA_DIST += test-import-order-a.scm test-import-order-b.scm \
+ test-import-order-c.scm test-import-order-d.scm
+
# test-num2integral
test_num2integral_SOURCES = test-num2integral.c
test_num2integral_CFLAGS = ${test_cflags}
--- /dev/null
+#!/bin/sh
+exec guile -q -L "$builddir" -s "$0" "$@"
+!#
+
+(define-module (base)
+ #:export (push! order))
+
+(define order '())
+(define (push!)
+ (set! order `(,@order ,(module-name (current-module)))))
+
+(define-module (test-1)
+ #:use-module (base)
+ #:use-module (test-import-order-a)
+ #:use-module (test-import-order-b))
+
+(use-modules (test-import-order-c) (test-import-order-d))
+
+(if (not (equal? order
+ '((test-import-order-a)
+ (test-import-order-b)
+ (test-import-order-c)
+ (test-import-order-d))))
+ (begin
+ (format (current-error-port) "Unexpected import order: ~a" order)
+ (exit 1))
+ (exit 0))
+
+;; Local Variables:
+;; mode: scheme
+;; End:
\ No newline at end of file