unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* macro syntax-error works in prefix but not curly-infix
@ 2021-09-04 14:41 Damien Mattei
  2021-09-19  6:23 ` adriano
  2021-09-19 12:34 ` Zelphir Kaltstahl
  0 siblings, 2 replies; 5+ messages in thread
From: Damien Mattei @ 2021-09-04 14:41 UTC (permalink / raw)
  To: guile-user

hi,

i have this macro:

(define-syntax <+
  (syntax-rules ()
    ((_ var expr) (define var expr))
    ((_ err ...) (syntax-error "Bad <- form")) ;; does not work in infix !
    ))

why my syntax-error pattern never reach in infix:

scheme@(guile-user)> {x <+ 7 8}
While compiling expression:
Syntax error:
unknown file:3:3: source expression failed to match any pattern in form <+

but ok in prefix:

scheme@(guile-user)> (<+ x 9 10)
While compiling expression:
Syntax error:
unknown location: <+: Bad <- form in form (<+ x 9 10)

why?
Regards,
Damien


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

end of thread, other threads:[~2021-09-20  9:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04 14:41 macro syntax-error works in prefix but not curly-infix Damien Mattei
2021-09-19  6:23 ` adriano
2021-09-19  7:48   ` Damien Mattei
2021-09-19 12:34 ` Zelphir Kaltstahl
2021-09-20  9:16   ` Damien Mattei

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).