Skip to content

Instantly share code, notes, and snippets.

@frenchy64
Created July 22, 2011 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frenchy64/1098856 to your computer and use it in GitHub Desktop.
Save frenchy64/1098856 to your computer and use it in GitHub Desktop.
(def pm2 (pattern-matrix [(pattern-row [wildcard (pattern false) (pattern true)] :a1)
(pattern-row [(pattern false) (pattern true) wildcard] :a2)
(pattern-row [wildcard wildcard (pattern false)] :a3)
(pattern-row [wildcard wildcard (pattern true)] :a4)]
'[x y z]))
(compile pm2)
#match.core.SwitchNode[y, [[<Pattern: true>
#match.core.SwitchNode[x, [[<Pattern: false>
#match.core.LeafNode[:a2]]
[default17534 #match.core.FailNode[]]]]]
[<Pattern: false>
#match.core.SwitchNode[z, [[<Pattern: true>
#match.core.LeafNode[:a1]]
[<Pattern: false> #match.core.LeafNode[:a3]]
[default17535 #match.core.FailNode[]]]]]
[default17536 #match.core.FailNode[]]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment