# Macro syntax error in some Scheme

**URL:** <https://racket.discourse.group/t/macro-syntax-error-in-some-scheme/1895>\
**Category:** Questions & Answers\
**Created:** [April 27, 2023, 10:08am UTC](https://racket.discourse.group/t/macro-syntax-error-in-some-scheme/1895 "2023-04-27T10:08:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [April 27, 2023, 10:08am UTC](https://racket.discourse.group/t/macro-syntax-error-in-some-scheme/1895/1 "2023-04-27T10:08:56Z")

</div>

hello,

why this macro good for Guile is not correct for Racket or Chicken:

```scheme
(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

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [April 27, 2023, 1:08pm UTC](https://racket.discourse.group/t/macro-syntax-error-in-some-scheme/1895/2 "2023-04-27T13:08:40Z")

</div>

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:

```scheme
#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](https://docs.racket-lang.org/guide/pattern-macros.html)

---

<div class="post-metadata">

**Author:** ![shawnw](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/shawnw/32/1031_2.png) [@shawnw](https://racket.discourse.group/u/shawnw)\
**Post date:** [April 27, 2023, 1:15pm UTC](https://racket.discourse.group/t/macro-syntax-error-in-some-scheme/1895/3 "2023-04-27T13:15:02Z")

</div>

That would also work in Chicken using the [miscmacros egg](https://wiki.call-cc.org/eggref/5/miscmacros) to get `define-syntax-rule`.
