From 5bbd93d93764545ba4a86ec8cf05184057acfade Mon Sep 17 00:00:00 2001 From: Alexey Radul Date: Wed, 22 May 2013 23:40:07 -0400 Subject: [PATCH] File heading and actually making it call the rules in order. --- pattern-dispatch.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pattern-dispatch.scm b/pattern-dispatch.scm index 70ed6e6..28f19da 100644 --- a/pattern-dispatch.scm +++ b/pattern-dispatch.scm @@ -19,6 +19,8 @@ (declare (usual-integrations)) +;;;; Pattern Dispatch + ;;; A pattern directed operator is a collection of rules, one of which ;;; is expected to match any datum that the operator may be given. ;;; The operator tries the rules in order until the first matches, and @@ -30,7 +32,7 @@ (define (fail) (error "No applicable operations" self arguments)) (try-rules arguments (reverse (entity-extra self)) succeed fail)) - (make-entity operator rules)) + (make-entity operator (reverse rules))) (define (pattern-dispatch . rules) (make-pattern-operator rules))