hello,
why this macro good for Guile is not correct for Racket or Chicken:
(define-macro (quote-all . Largs)
(if (null? Largs)
`(quote ,Largs)
`(cons (quote ,(car Largs)) (quote-all ,@(cdr Largs)))))
error is :
#%app: bad syntax in: (#%app quote-all . largs)
i tried Racket and R5RS
Regards,
Damien
There are different types of macro systems.
The one in R5RS is pattern based.
Both Racket and Chicken extend the pattern based macros in R5RS.
Here is an example:
#lang racket
(define-syntax-rule
; Input Syntax
(quote-all datum ...)
; Output Syntax
(list (quote datum) ...))
(quote-all 1 2 3) ; => '(1 2 3)
You can read more here:
https://docs.racket-lang.org/guide/pattern-macros.html
2 Likes
shawnw
3
That would also work in Chicken using the miscmacros egg to get define-syntax-rule
.
2 Likes