Behavior of clojure.string/replace differs from Clojure

Description

When using clojure.string/replace with a function as the replacement value, and using a regular expression with capturing groups, the behavior differs between Clojure and ClojureScript. In Clojure, the replacement fn is passed a tuple of the match and capturing group. In ClojureScript, it is only passed the match value.

In Clojure:

In ClojureScript:

Environment

None

Activity

Show:
andrewhr
August 27, 2015, 3:50 PM

Rebased patch against master.

David Nolen
August 27, 2015, 11:54 AM

This patch needs to be rebased to master.

andrewhr
June 14, 2015, 4:41 AM

Hi David, I understand and appreciate your concerns I just want to make clear what I've search and done, sorry if I sound rude - maybe I stepped on my language limitations.

Francis, really this re-* thing is tricky to deal with. I will take a closer look onto your ticket and see if I can add any idea.

Thanks everyone!

David Nolen
June 14, 2015, 2:51 AM

Andrew, was just looking for rationale. What you've done looks OK to me. People should try the patch and give feedback. Thanks!

Completed

Assignee

andrewhr

Reporter

Luke VanderHart

Patch

Code and Test