(Arne Babenhauserheide)
2016-01-27: working enter three witches. working enter three witches.
diff --git a/examples/enter-three-witches.w b/examples/enter-three-witches.w
--- a/examples/enter-three-witches.w
+++ b/examples/enter-three-witches.w
@@ -4,18 +4,28 @@ exec guile -L $(dirname $(dirname $(real
define-module : examples enter-three-witches
+use-modules : ice-9 optargs
+
define-syntax Enter
syntax-rules ()
- : _ name b ...
+ : _ (name) b ...
begin
define-syntax name
syntax-rules ::: ()
- : _ words :::
- format #t "~A\n"
- string-join
- map : lambda (x) (string-join (map symbol->string x))
- quote : words :::
- . "\n"
+ : _ (c :::) d :::
+ format #t "~A\n ~A\n\n"
+ string-join
+ string-split (symbol->string 'name) #\_
+ string-join
+ map : lambda (x) (string-join (map symbol->string x))
+ quote : (c :::) d :::
+ . "\n "
+ : _ c d :::
+ begin
+ format #t "~A:\n" : symbol->string 'c
+ name d :::
+ : _ c :::
+ begin #t c :::
Enter b ...
: _ b ...
begin
@@ -28,7 +38,17 @@ define-syntax Enter
; . "\n"
define : main args
- Enter First_Witch
+ Enter : First_Witch
+ Second_Witch
+ Third_Witch
+
First_Witch
When shall we three meet again
In thunder, lightning, or in rain?
+
+ Second_Witch
+ When the hurlyburly's done,
+ When the battle's lost and won.
+
+ Third_Witch
+ That will be ere the set of sun.