rewrite-clj icon indicating copy to clipboard operation
rewrite-clj copied to clipboard

Should regex node sexpr return a regex?

Open lread opened this issue 4 years ago • 0 comments

The regex-node constructor fn accepts a string-pattern. It is called when parsing #regexa where regexa becomes the string-pattern.

The sexpr returns (list 're-pattern string-pattern).

Should it return (re-pattern string-pattern) (an actual regex?).

Notes

  • If we do decide to do something about sexpr remember that regex implementations are platform specific. A reminder of that in the user guide should be considered.
  • Docstring for regex node constructor should clarify string-pattern usage and escaping.
  • Remember that in Clojure (= #"myregex" #"myregex") returns false. Someone searching through nodes via sexpr, would have to remember this fact.

lread avatar Feb 11 '21 19:02 lread