diff options
author | michele.simionato <devnull@localhost> | 2009-04-20 05:10:03 +0000 |
---|---|---|
committer | michele.simionato <devnull@localhost> | 2009-04-20 05:10:03 +0000 |
commit | 573abefd1cd7e13181a2b53a44619234c449ae6c (patch) | |
tree | def307839ca35bd54b3015df6f9992d16c785b7e /scheme | |
parent | c214d459cad0a463716c83c9eb12f22c9c42bf75 (diff) | |
download | micheles-573abefd1cd7e13181a2b53a44619234c449ae6c.tar.gz |
Committed a lot of work on the Scheme module system
Diffstat (limited to 'scheme')
-rw-r--r-- | scheme/aps/compat.ypsilon.sls | 9 | ||||
-rw-r--r-- | scheme/experimental/def-m1.sls | 13 | ||||
-rw-r--r-- | scheme/experimental/mod1.sls | 10 | ||||
-rw-r--r-- | scheme/experimental/mod2.sls | 14 | ||||
-rw-r--r-- | scheme/experimental/mod3.sls | 21 | ||||
-rw-r--r-- | scheme/experimental/use-mod3.ss | 3 | ||||
-rw-r--r-- | scheme/sweet-macros/main.sls | 5 |
7 files changed, 69 insertions, 6 deletions
diff --git a/scheme/aps/compat.ypsilon.sls b/scheme/aps/compat.ypsilon.sls index 5c5dee3..d1353ea 100644 --- a/scheme/aps/compat.ypsilon.sls +++ b/scheme/aps/compat.ypsilon.sls @@ -1,10 +1,7 @@ (library (aps compat) -(export printf - (rename (ypsilon:format format) - (ypsilon:gensym gensym) - (ypsilon:pretty-print pretty-print))) -(import (rnrs) (prefix (core) ypsilon:)) +(export printf format gensym pretty-print))) +(import (rnrs) (core)) (define (printf format-string . args) - (display (apply ypsilon:format format-string args))) + (display (apply format format-string args))) ) diff --git a/scheme/experimental/def-m1.sls b/scheme/experimental/def-m1.sls new file mode 100644 index 0000000..1201089 --- /dev/null +++ b/scheme/experimental/def-m1.sls @@ -0,0 +1,13 @@ +#!r6rs +(library (experimental def-m1) +(export m1) +(import (rnrs) (sweet-macros) (for (only (experimental registry) register) + expand)) + +(def-syntax m1 + (begin + (register #'m1) + (syntax-match () (sub (m1) #'1)))) + +(m1) +) diff --git a/scheme/experimental/mod1.sls b/scheme/experimental/mod1.sls new file mode 100644 index 0000000..5cc42ad --- /dev/null +++ b/scheme/experimental/mod1.sls @@ -0,0 +1,10 @@ +#!r6rs +(library (experimental mod1) + (export x incr-x) + (import (rnrs)) + + (define x 0) + (define (incr-x) + (set! x (+ 1 x)) + x) +) diff --git a/scheme/experimental/mod2.sls b/scheme/experimental/mod2.sls new file mode 100644 index 0000000..cc35ca1 --- /dev/null +++ b/scheme/experimental/mod2.sls @@ -0,0 +1,14 @@ +#!r6rs +(library (experimental mod2) + (export get-x incr-x) + (import (rnrs)) + + (define x 0) + + (define (get-x) + x) + + (define (incr-x) + (set! x (+ 1 x)) + x) +) diff --git a/scheme/experimental/mod3.sls b/scheme/experimental/mod3.sls new file mode 100644 index 0000000..88a41ac --- /dev/null +++ b/scheme/experimental/mod3.sls @@ -0,0 +1,21 @@ +#!r6rs +(library (experimental mod3) +(export run) +(import (rnrs) (sweet-macros) (for (experimental mod2) expand run)) + +(def-syntax m + (begin + (display "At expand-time x=") + (display (incr-x)) + (newline) + (syntax-match () (sub (m) #'#'f)))) + +(define (run) ;; this is executed at runtime + (display "At run-time x=") + (display (incr-x)) + (newline)) + +(m) ;; this is executed at expand time + +) + diff --git a/scheme/experimental/use-mod3.ss b/scheme/experimental/use-mod3.ss new file mode 100644 index 0000000..5a33b6e --- /dev/null +++ b/scheme/experimental/use-mod3.ss @@ -0,0 +1,3 @@ +#!r6rs +(import (rnrs) (experimental mod3)) +(run) diff --git a/scheme/sweet-macros/main.sls b/scheme/sweet-macros/main.sls index 858dc65..b1de309 100644 --- a/scheme/sweet-macros/main.sls +++ b/scheme/sweet-macros/main.sls @@ -1,4 +1,9 @@ (library (sweet-macros) +;;; Version: 0.8 +;;; Author: Michele Simionato +;;; Email: michele.simionato@gmail.com +;;; Date: 19-Apr-2009 +;;; Licence: BSD (export syntax-match def-syntax syntax-expand sub) (import (rnrs)) |