ClojureScript

IEquiv implementation for regular expressions.

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

In Clojure the form (= #"a" #"a") returns true. In ClojureScript
the formt returns false, which is the same behaviour as in
JavaScript.

What is the supposed behaviour in ClojureScript, true or false?

The Clojure behaviour could be implemented like this:

(extend-type js/RegExp
IEquiv
(-equiv [o other]
(-equiv (str o) (str other))))

Activity

Hide
David Nolen added a comment -

Backtracking, this triggers a Google Closure Compiler warning that says it can no longer optimize RegExps

Show
David Nolen added a comment - Backtracking, this triggers a Google Closure Compiler warning that says it can no longer optimize RegExps
Hide
David Nolen added a comment -

I'm closing this for now. If people want equality for RegExps they can do that in their own projects.

Show
David Nolen added a comment - I'm closing this for now. If people want equality for RegExps they can do that in their own projects.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: