1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 06:20:23 +02:00

match bare literals with eq? in pmatch, not equal?

* module/system/base/pmatch.scm (ppat): Match atoms with eq?, not equal?.
  This speeds up compilation considerably, as we never match against
  numbers or strings or what-have-you. Note, you can match against
  literals with equal? via quoting the literal in the pattern.
This commit is contained in:
Andy Wingo 2009-02-10 13:18:36 +01:00
parent 028e3d0666
commit 8899057d65

View file

@ -39,4 +39,4 @@
(let ((vx (car v)) (vy (cdr v)))
(ppat vx x (ppat vy y kt kf) kf))
kf))
((_ v lit kt kf) (if (equal? v (quote lit)) kt kf))))
((_ v lit kt kf) (if (eq? v (quote lit)) kt kf))))