Created
July 14, 2009 20:10
-
-
Save fffej/147156 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar | |
dispatch-table | |
{:single-match | |
{'?is match-is '?or match-or '?and match-and '?not match-not} | |
:segment-match | |
{'?* segment-match '?+ segment-match+ '?? segment-match? '?if match-if}} | |
"Dispatch table") | |
(defn single-match-fn | |
"Get the single-match function for x, if it is a symbol that has one." | |
[x] | |
(when (symbol? x) ((dispatch-table :single-match) x))) | |
(defn segment-match-fn | |
"Get the segment-match function for x, if it is a symbol that has one." | |
[x] | |
(when (symbol? x) ((dispatch-table :segment-match) x))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment