source: project/modules/trunk/modules.scm @ 6419

Last change on this file since 6419 was 6419, checked in by felix winkelmann, 13 years ago

merged with portability branch (-r6222:6412)

File size: 1.0 KB
Line 
1;;;; modules.scm
2
3
4(cond-expand
5
6 (syntax-case)                          ; use builtin modules
7
8 (syntactic-closures
9
10(require 'modules-base)
11
12(define-syntax module
13  (rsc-macro-transformer
14   (lambda (exp env)
15     (modules:expand-module (cdr exp)) ) ) )
16
17(define-syntax import
18  (rsc-macro-transformer
19   (lambda (exp env)
20     (modules:expand-import (cadr exp)) ) ) )
21
22(define-syntax import*
23  (rsc-macro-transformer
24   (lambda (exp env)
25     (modules:expand-import* (cadr exp) (cddr exp)) ) ) )
26
27(define-syntax export-toplevel
28  (rsc-macro-transformer
29   (lambda (exp env)
30     (modules:expand-export-toplevel (cdr exp)) ) ) ) 
31
32)
33
34 ((not hygienic-macros)
35
36(require 'modules-base)
37
38(define-macro (module . args)
39  (modules:expand-module args) )
40
41(define-macro (import mod)
42  (modules:expand-import mod) )
43
44(define-macro (import* mod . is)
45  (modules:expand-import* mod is) )
46
47(define-macro (export-toplevel . args)  ; suggested by Kon Lovett
48  (modules:expand-export-toplevel args) )
49
50)
51
52 (else
53  (error "the `modules' extension is not supported for the currently used macro system") ) )
Note: See TracBrowser for help on using the repository browser.