I have some Clojure code that uses clojure.string/replace and when I compiled 
it as Clojurescript it stopped working.

I can recreate the problem with the following code:

(defn print-results
  [results]
  (println (str "results: " results))
  (println (str "(type results): " (type results)))
  "done")

(clojure.string/replace "one and two and three" #"(.+) and (.+) and (.+)" 
(partial print-results))

In the Clojure REPL I get:

results: ["one and two and three" "one" "two" "three"]
(type results): class clojure.lang.PersistentVector
"done"

In the Clojurescript REPL I get:

results: one and two and three
(type results): function String() { [native code for String.String, arity=1] }
"done"

It appears that the Clojurescript version returns a string and I lose the 
ability to use regexp groups that are provided in the result vector provided by 
the Clojure version.

My code relies on manipulating the group data for the proper replacement. Is 
this by design or a potential bug?

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to