unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* reserved-keyword in macro
@ 2022-02-02 10:13 Damien Mattei
  2022-02-02 10:33 ` Maxime Devos
  0 siblings, 1 reply; 10+ messages in thread
From: Damien Mattei @ 2022-02-02 10:13 UTC (permalink / raw)
  To: guile-user

hello,
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.

regards,
damien


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-02-04 16:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 10:13 reserved-keyword in macro Damien Mattei
2022-02-02 10:33 ` Maxime Devos
     [not found]   ` <CADEOaddzjFbSYvVGEOkrSrjHSZvUkqC9beiRw29jbH3XHeRkZw@mail.gmail.com>
2022-02-02 13:02     ` Fwd: " Damien Mattei
2022-02-02 21:23       ` Damien Mattei
2022-02-02 21:38         ` Damien Mattei
2022-02-03  0:52           ` Vijay Marupudi
2022-02-03 10:09             ` Damien Mattei
2022-02-04  8:21               ` Damien Mattei
2022-02-04 16:24                 ` Damien Mattei
2022-02-04 16:44                   ` Maxime Devos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).