<< Back to previous view

[MATCH-109] Call `emit-pattern` and `to-source` to let'ed things. {code:clojure} (let [x "hello" y :foo x-regex #"Hello"] (match [x y] [x-regex y] :match :else :no-match)) {code} Created: 24/May/15  Updated: 24/May/15

Status: Open
Project: core.match
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: David Rojas Assignee: David Nolen
Resolution: Unresolved Votes: 0
Labels: None

Comment by David Rojas [ 24/May/15 9:16 PM ]

Apologies for the ugly description. This is my first time with this issue tracker.

Well, I want to extend `match` to my data structures but can't find yet how to make it call `emit-pattern` and `to-source` on them.

This is similar to how I was trying to do it (not with regexes).

(let [x "hello"
      y :foo
      x-regex #"hello"]
  (match [x y]
         [x-regex y] :match
         :else       :no-match))
Comment by David Rojas [ 24/May/15 10:09 PM ]

I've realised that this is not practical. However, how can I extend match to other types (other than java.util.regex.Pattern). I mean, for regexes the reader macro delivers an instance of Pattern directly to the matrix, but how to achieve the same for a type that doesn't have an analogous reader macro?.

Generated at Thu May 28 11:10:52 CDT 2015 using JIRA 4.4#649-r158309.