From 5c33a39d4b56e78a9805fa2dc4120d7c8b3dd954 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Wed, 2 Mar 2011 01:09:49 +0900 Subject: [PATCH] Allowing rename exports. --- lib/config.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/config.scm b/lib/config.scm index 5542f1dc..95826674 100644 --- a/lib/config.scm +++ b/lib/config.scm @@ -140,11 +140,19 @@ (let ((name (cadr expr)) (body (cddr expr))) `(let ((tmp *this-module*)) + (define (rewrite-export x) + (if (pair? x) + (if (and (= 3 (length x)) + (eq? 'rename (identifier->symbol (car x)))) + (cons (caddr x) (cadr x)) + (error "invalid module export" x)) + x)) (set! *this-module* '()) ,@body (set! *this-module* (reverse *this-module*)) (let ((exports - (cond ((assq 'export *this-module*) => cdr) + (cond ((assq 'export *this-module*) + => (lambda (x) (map rewrite-export (cdr x)))) (else '())))) (set! *modules* (cons (cons ',name (make-module exports #f *this-module*))