From 8899057d65da670da74c90ae44e3ce78ec695ddd Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 10 Feb 2009 13:18:36 +0100 Subject: [PATCH] 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. --- module/system/base/pmatch.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/system/base/pmatch.scm b/module/system/base/pmatch.scm index 260d452dd..ed61464f0 100644 --- a/module/system/base/pmatch.scm +++ b/module/system/base/pmatch.scm @@ -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))))