mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 14:50:19 +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:
parent
028e3d0666
commit
8899057d65
1 changed files with 1 additions and 1 deletions
|
@ -39,4 +39,4 @@
|
||||||
(let ((vx (car v)) (vy (cdr v)))
|
(let ((vx (car v)) (vy (cdr v)))
|
||||||
(ppat vx x (ppat vy y kt kf) kf))
|
(ppat vx x (ppat vy y kt kf) 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))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue