Macro syntax error in some Scheme


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



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
  ; Input Syntax
  (quote-all datum ...)

  ; Output Syntax
  (list (quote datum) ...))

(quote-all 1 2 3)  ; => '(1 2 3)

You can read more here:

1 Like

That would also work in Chicken using the miscmacros egg to get define-syntax-rule.

1 Like