Re: [ClojureScript] Re: No regexp groups in Clojurescript clojure.string/replace

2015-09-07 Thread Lance Campbell
Daniel,

You are correct!

I updated to version 1.7.122 and the problem goes away :).

Thanks for your help.

Lance.

-- 
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: No regexp groups in Clojurescript clojure.string/replace

2015-09-07 Thread Lance Campbell
Okay, I played around a bit more with this problem over the long weekend and I 
found my groups. Running the following code:

(defn print-results
  [& rest]
  (println (str rest))
  "done")

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

In the Clojure REPL I get:

(["one and two and three" "one" "two" "three"])
"done"

In the Clojurescript REPL I get:

("one and two and three" "one" "two" "three" 0 "one and two and three")
"done"

So, it appears that Clojure passes a single array argument whereas 
Clojurescript passes multiple arguments. So the code needs to be different for 
each language, but at least I found my groups :).

-- 
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] No regexp groups in Clojurescript clojure.string/replace

2015-09-05 Thread Lance Campbell
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Namespaces in ClojureScript that begin with "clojure"

2015-08-14 Thread Lance Campbell
You understood my question. Thanks for the insight.

On Friday, August 14, 2015 at 1:42:40 PM UTC-7, Linus Ericsson wrote:
> I'm not sure if I understand your question, but there's no apparent way 
> clojure.browser.dom would make any sense since it doesn't (or at least 
> didn't) map to any specific JVM host language feature, but was very relevant 
> in clojurescript, at least in the pre-react era.
> 
> The stranger part is probably that some libraries are name for instance 
> clojure.core.async and cljs.core.async for the different hosts. With the new 
> conditional readers in 1.7.0 I think we could expect these libraries will 
> harmonize the nameing to clojure.core...
> 
> /Linus
> 
> Just curious.
> 
> 
> 
> There are several ClojureScript namespaces that begin with "clojure" that are 
> available in both Clojure and ClojureScript, for example clojure.set and 
> clojure.string.
> 
> 
> 
> Then there are namespaces like clojure.browser.dom that do not have a 
> corresponding namespace in Clojure.
> 
> 
> 
> Why the difference?
> 
> 
> 
> --
> 
> 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 clojurescrip...@googlegroups.com.
> 
> To post to this group, send email to clojur...@googlegroups.com.
> 
> Visit this group at http://groups.google.com/group/clojurescript.

-- 
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Namespaces in ClojureScript that begin with "clojure"

2015-08-14 Thread Lance Campbell
Just curious.

There are several ClojureScript namespaces that begin with "clojure" that are 
available in both Clojure and ClojureScript, for example clojure.set and 
clojure.string.

Then there are namespaces like clojure.browser.dom that do not have a 
corresponding namespace in Clojure.

Why the difference?

-- 
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 clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.