aboutsummaryrefslogtreecommitdiffstats
path: root/define-namespace-7.scm
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2024-07-29 14:01:20 -0400
committerGravatar Peter McGoron 2024-07-29 14:01:20 -0400
commit5a5fbd861fbd199a1611874d1810a41796bff83e (patch)
treefd0b8cec56289032b374aa0e94bb819427325031 /define-namespace-7.scm
define-namespace and SRFI-1
Diffstat (limited to 'define-namespace-7.scm')
-rw-r--r--define-namespace-7.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/define-namespace-7.scm b/define-namespace-7.scm
new file mode 100644
index 0000000..6c93183
--- /dev/null
+++ b/define-namespace-7.scm
@@ -0,0 +1,21 @@
+;;; Compatability layer to translate DEFINE-NAMESPACE to R7RS's
+;;; DEFINE-LIBRARY.
+
+(define-syntax import-from-namespace
+ (syntax-rules ()
+ ((import-from-namespace body ...) (import body ...))))
+
+(define-syntax define-namespace
+ (syntax-rules ()
+ ((define-namespace ns body ...)
+ (define-library (namespace ns) body ...))))
+
+(display "hello world\n")
+
+(define-namespace blah
+ (begin
+ (define x 5)))
+
+(define-library (namespace blah)
+ (begin
+ (define (x) 5)))