Skip to content

Commit

Permalink
File heading and actually making it call the rules in order.
Browse files Browse the repository at this point in the history
  • Loading branch information
axch committed May 23, 2013
1 parent 53c0978 commit 5bbd93d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pattern-dispatch.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit 5bbd93d

Please sign in to comment.