On Thu, Aug 27, 2009 at 11:41 AM, Sean Devlin<francoisdev...@gmail.com> wrote:
>
> On Aug 27, 1:06 am, Timothy Pratley <timothyprat...@gmail.com> wrote:
>>
>>  If #"X" created a (re-fn "X") then all the re functions could accept
>> a function and call it in order to avoid having to do (re-find (pp)
>> s). The previous signature could be retained so that they would work
>> with either type of arguments if that were desirable. The downside is
>> trying to explain that in the docs might be confusing - so a wrapper
>> seems more obvious for that.

The benefits of #"" producing a real java.util.regex.Pattern
object instead of some Clojury wrapper will decrease as it
becomes more common to write Clojure code that can run on
non-JVM platforms.  So although this idea has come up and
then been abandoned several times before, I think it's worth
bringing up again periodically to see what makes sense.

>> Oh - it seems like re-seq does the most work so perhaps that is the
>> best candidate?
>
> The only feature I want is the ability to use a regex as a predicate.
> So, I'd prefer something like re-matches.  Maybe this isn't the
> biggest use case, though.

Pretty much anything that can be concluded by using
re-matches can also be found using re-seq, so I think I'd
prefer the latter.  One proviso being that currently re-seq
returns an empty list, not nil, when there are no matches.
This does reduce its utility as a predicate.  Would
automatically forcing the first step to get a nice 'nil' be
unacceptable?

--Chouser

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to