On Aug 26, 2009, at 9:17 PM, Sean Devlin wrote:
> Okay, I'm sure this has come up before. I was just wondering if
> anyone knew why the regex literal doesn't implement IFn?
>
> At first glance it seems like the following would be useful:
>
> user=>(#"\d{3}" "123")
> true
>
> This is defined as...
> user=>(not (nil? (re-matches #"\d{3}" "123")))
> true
>
> What am I missing?
The #" form produces Java Pattern objects:
user=> (class #"foo")
java.util.regex.Pattern
user=>
...which of course aren't IFns.
- Chas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---