[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

reserved-keyword in macro

From: Damien Mattei
Subject: reserved-keyword in macro
Date: Wed, 2 Feb 2022 11:13:53 +0100

what is the best way to use a reserved keyword in a macro (a keyword for me
not already used in scheme):
if i have multiple patterns in a macro,for example:
(define-syntax macro
  (syntax-rules ()
((_ arg1 arg2) code1)
((_ reserved-keyword arg) code2)))

now if i call the macro with (macro reserved-keyword 777) code1 is expansed
but not code2

i can merge code1 and code2 and do some inner test to check
reserved-keyword like this:

  (if (equal? (quote arg1) (quote reserved-keyword)) ;; test
which had worked in past but is there a better way like :
(define-syntax macro
  (syntax-rules (reserved-keyword)
but i can not fix it to work.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]