[plt-scheme] more macro
Ivanyi Peter skrev:
> Hi there,
>
> I have noticed the following with macros. I could use macros
> to remove the quote sign, for example:
>
> (define-syntax m1
> (lambda (x)
> (syntax-case x ()
> ((_ 'f e1 e2 ...)
> (syntax (f e1 e2 ...))))))
Since 'f is short for (quote f) it might be worth trying
(define-syntax m1
(lambda (x)
(syntax-case x (quote)
((_ 'f e1 e2 ...)
(syntax (f e1 e2 ...))))))
>
> Usage:
> (syntax-object->datum (expand-once #'(m1 't a b c d)))
> Result:
> (t a b c d)
>
> I do not know whether it is a feature or a bug.
Which result did you expect?
--
Jens Axel Søgaard