[Top][All Lists]

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

Re: [PATCH] Preserve keyword in 'syntax-rules' and 'define-syntax-rule'

From: Mark H Weaver
Subject: Re: [PATCH] Preserve keyword in 'syntax-rules' and 'define-syntax-rule'
Date: Wed, 10 Oct 2012 13:41:49 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Unfortunately, preserving the macro keyword breaks one of Oleg
Kiselyov's macros, namely 'ppat' in system/base/pmatch.scm:

--8<---------------cut here---------------start------------->8---
(define-syntax ppat
  (syntax-rules (_ quote unquote)
    ((_ v _ kt kf) kt)
    ((_ v () kt kf) (if (null? v) kt kf))
    ((_ v (quote lit) kt kf)
     (if (equal? v (quote lit)) kt kf))
    ((_ v (unquote var) kt kf) (let ((var v)) kt))
    ((_ v (x . y) kt kf)
     (if (pair? v)
         (let ((vx (car v)) (vy (cdr v)))
           (ppat vx x (ppat vy y kt kf) kf))
    ((_ v lit kt kf) (if (eq? v (quote lit)) kt kf))))
--8<---------------cut here---------------end--------------->8---

Oleg's macro uses '_' in the keyword position of the pattern, even
though '_' is in the literals list.  Therefore, it fails to match
because 'ppat' does not match that literal.

Among other things, this broke our build, which is why Hydra has been
failing to build Guile recently.

I reverted the change.


reply via email to

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