Hi all,
I met this problem when having some experiments with define-syntax.
Just cannot understand what I do wrong.
(define-syntax test
(syntax-rules ()
((test)
(lambda args
(match args
('a (display "Test:a\n"))
('b (display "Test:b\n"))
('c (display "Test:c\n"))
(_ (display "Unknown message\n")) ) ))))
(define t (test))
(t 'a)
This is a simplified part of the code. Executing this leads to following
error
Backtrace:
In unknown file:
?: 0* [t a]
?: 1 (if (equal? args (quote a)) ((lambda () (display "Test:a
"))) ...)
?: 2* [equal? ...
<unnamed port>: While evaluating arguments to equal? in expression (equal?
args (quote a)):
<unnamed port>: Unbound variable: args
ABORT: (unbound-variable)
with guile-1.8.7, and to
Throw to key `unbound-variable':
ERROR: In procedure module-lookup:
ERROR: Unbound variable: args
Entering the debugger. Type `bt' for a backtrace or `c' to continue.
with guile-1.9.11.
Does it mean I cannot use (match ...) within macro-definition?
Thanks!