diff options
author | michele.simionato <devnull@localhost> | 2009-03-21 04:26:32 +0000 |
---|---|---|
committer | michele.simionato <devnull@localhost> | 2009-03-21 04:26:32 +0000 |
commit | 9e1a6ab001bcbc7a4b3e55f2682cb20526a0b97a (patch) | |
tree | 8d567bd18281a23ccd105b1d3bd2a5ad247b3a20 /scheme | |
parent | a17d4396b8b2458fc92bfd71bd91373094d84744 (diff) | |
download | micheles-9e1a6ab001bcbc7a4b3e55f2682cb20526a0b97a.tar.gz |
Removed obsolete module
Diffstat (limited to 'scheme')
-rw-r--r-- | scheme/sweet-macros-plt/helper1.sls | 56 | ||||
-rw-r--r-- | scheme/sweet-macros-plt/helper2.sls | 14 | ||||
-rw-r--r-- | scheme/sweet-macros-plt/main.sls | 9 |
3 files changed, 0 insertions, 79 deletions
diff --git a/scheme/sweet-macros-plt/helper1.sls b/scheme/sweet-macros-plt/helper1.sls deleted file mode 100644 index be9a407..0000000 --- a/scheme/sweet-macros-plt/helper1.sls +++ /dev/null @@ -1,56 +0,0 @@ -#!r6rs -;;; sweet-macros -;;; Version: 0.2 -;;; Author: Michele Simionato -;;; Email: michele.simionato@gmail.com -;;; Date: 04-Nov-2008 -;;; Licence: BSD - -(library (sweet-macros helper1) -(export guarded-syntax-case syntax-match) -(import (rnrs)) - -;; helper macro -(define-syntax guarded-syntax-case - (let ((add-clause - (lambda (clause acc) - (syntax-case clause () - ((pattern skeleton . rest) - (syntax-case #'rest () - ((cond? else1 else2 ...) - (cons* - #'(pattern cond? skeleton) - #'(pattern (begin else1 else2 ...)) - acc)) - ((cond?) - (cons #'(pattern cond? skeleton) acc)) - (() - (cons #'(pattern skeleton) acc)) - )))))) - (lambda (x) - (syntax-case x () - ((guarded-syntax-case y (literal ...) clause ...) - (with-syntax - (((c ...) (fold-right add-clause '() #'(clause ...)))) - #'(syntax-case y (literal ...) c ...))))))) - -(define-syntax syntax-match - (lambda (x) - (syntax-case x (sub) - ((self (literal ...) (sub patt skel . rest) ...) - #'(lambda (x) (self x (literal ...) (sub patt skel . rest) ...))) - ((self x (literal ...) (sub patt skel . rest) ...) - (and (identifier? #'x) (for-all identifier? #'(literal ...))) - #'(guarded-syntax-case x - (<literals> <patterns> <source> <transformer> literal ...) - ((ctx <literals>) - #''((... (... literal)) ...)) - ((ctx <patterns>) - #''((... (... patt)) ...)) - ((ctx <source>) - #''(self (literal ...) (... (... (sub patt skel . rest))) ...)) - ((ctx <transformer>) - #'(self (literal ...) (... (... (sub patt skel . rest))) ...)) - (patt skel . rest) ...)) - ))) -) diff --git a/scheme/sweet-macros-plt/helper2.sls b/scheme/sweet-macros-plt/helper2.sls deleted file mode 100644 index 554e908..0000000 --- a/scheme/sweet-macros-plt/helper2.sls +++ /dev/null @@ -1,14 +0,0 @@ -#!r6rs - -(library (sweet-macros helper2) -(export def-syntax syntax-match) -(import (rnrs) (for (sweet-macros helper1) run expand)) - -(define-syntax def-syntax - (syntax-match () - (sub (def-syntax (name . args) skel . rest) - #'(define-syntax name (syntax-match () (sub (name . args) skel . rest)))) - (sub (def-syntax name transformer) - #'(define-syntax name transformer)) - )) -) diff --git a/scheme/sweet-macros-plt/main.sls b/scheme/sweet-macros-plt/main.sls deleted file mode 100644 index 3b1b1a3..0000000 --- a/scheme/sweet-macros-plt/main.sls +++ /dev/null @@ -1,9 +0,0 @@ -#!r6rs - -(library (sweet-macros) -(export def-syntax syntax-match syntax-expand) -(import (rnrs) (for (sweet-macros helper2) run expand)) - -(def-syntax (syntax-expand (macro . args)) - #'(syntax->datum ((macro <transformer>) #'(macro . args)))) -) |