Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 1.27 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.   (def pm2 (pattern-matrix [(pattern-row [wildcard (pattern false) (pattern true)] :a1)
  2.                             (pattern-row [(pattern false) (pattern true) wildcard] :a2)
  3.                             (pattern-row [wildcard wildcard (pattern false)] :a3)
  4.                             (pattern-row [wildcard wildcard (pattern true)] :a4)]
  5.                            '[x y z]))
  6.  
  7.  
  8. (compile pm2)
  9.  
  10. ;#match.core.SwitchNode[
  11. ;         1,
  12. ;         [[<Pattern: true> #match.core.PatternMatrix[
  13. ;           [#match.core.PatternRow[
  14. ;             [<Pattern: false> <Pattern: true>], :a1]
  15. ;            #match.core.PatternRow[
  16. ;             [<Pattern: _> <Pattern: false>], :a3]
  17. ;            #match.core.PatternRow[
  18. ;             [<Pattern: _> <Pattern: true>], :a4]], [y z]]]
  19. ;                        
  20. ;                        
  21. ;         [<Pattern: false> #match.core.PatternMatrix[
  22. ;           [#match.core.PatternRow[
  23. ;             [<Pattern: false> <Pattern: true>], :a1]
  24. ;            #match.core.PatternRow[
  25. ;             [<Pattern: true> <Pattern: _>], :a2]
  26. ;            #match.core.PatternRow[
  27. ;             [<Pattern: _> <Pattern: false>], :a3]
  28. ;            #match.core.PatternRow[
  29. ;             [<Pattern: _> <Pattern: true>], :a4]], [y z]]]
  30. ;          
  31. ;          [default #match.core.FailNode[]]]]