Clojure

Add regexp? Predicate like in ClojureScript

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: Release 1.9
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

ClojureScript has a regexp? predicate. Clojure should have the same for java.util.regex.Pattern.

Activity

Hide
Alex Miller added a comment -

This has been considered and rejected multiple times in the past. Could you give me an example of code that would use such a thing in the ClojureScript world?

I think there is an argument to be made for portability that is stronger now than when previously requested, but I can't say I see this (yet) as a need common enough to warrant a core predicate.

Show
Alex Miller added a comment - This has been considered and rejected multiple times in the past. Could you give me an example of code that would use such a thing in the ClojureScript world? I think there is an argument to be made for portability that is stronger now than when previously requested, but I can't say I see this (yet) as a need common enough to warrant a core predicate.
Hide
Alex Miller added a comment -

cross-clj reports only 2 usages: https://crossclj.info/fun/cljs.core.cljs/regexp%3F.html

  • one in cljs itself and one in another location. I looked through 35 pages of github search results and only saw maybe one place where it might have been used.

Based on that, I'd say the bulk of users don't need a predicate for regexp? and it's not worth adding to core over just #(instance? java.util.regex.Pattern %) in the rare cases where you need it.

Going to decline this but happy to reconsider later if there is a compelling reason.

Show
Alex Miller added a comment - cross-clj reports only 2 usages: https://crossclj.info/fun/cljs.core.cljs/regexp%3F.html
  • one in cljs itself and one in another location. I looked through 35 pages of github search results and only saw maybe one place where it might have been used.
Based on that, I'd say the bulk of users don't need a predicate for regexp? and it's not worth adding to core over just #(instance? java.util.regex.Pattern %) in the rare cases where you need it. Going to decline this but happy to reconsider later if there is a compelling reason.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: