Hi all,
I have been trying to get the browser repl to work tonight.
I can't get this to work and have tracked the issue down to an apparent
problem with the keyword function.
I have not seen this behaviour before. I pulled the latest clojurescript
today.
This may be a problem with my setup. Has anyone seen anything like the
following:
(defn log [x]
(.log js/console x))
(def test-map {:peer_uri 1})
(log test-map)
(log :peer_uri)
; �'peer_uri
(log (cljs.core.keyword? :peer_uri))
; true
(log (cljs.core.keyword "peer_uri"))
; :'peer_uri
(log (cljs.core.keyword? (keyword "peer_uri")))
; false
(log (get test-map :peer_uri "not found"))
; 1
(log (get test-map (cljs.core.keyword "peer_uri") "not found")) ;
not found
effectively (keyword "x") does not return a keyword. which breaks things.
(I am being explicit with cljs.core.keyword above to ensure that I have not
redefined the function)
I have checked HTTP meta tags and compiled as both simple and advanced.
...
After more digging, I think that that this may be due to changes to the str
function:
d3cba99b<https://github.com/clojure/clojurescript/commit/d3cba99b7741f8fc445f21b4cddf0ea4ee96a1cb>
»<https://github.com/clojure/clojurescript/blame/d3cba99b7741f8fc445f21b4cddf0ea4ee96a1cb/src/cljs/cljs/core.cljs>
swannodette <https://github.com/swannodette>
2011-10-10 * src/cljs/cljs/core.cljs: CLJS-84: Behavior of (s...
(from my browser console)
cljs.core.keyword
function (b, c) { switch(arguments.length) { case 1: return
cljs.core.truth_(cljs.core.keyword_QMARK_.call(null, b)) ? b :
cljs.core.truth_(cljs.core.symbol_QMARK_.call(null, b)) ?
cljs.core.str.call(null, "\ufdd0", "'", cljs.core.subs.call(null, b, 2)) :
cljs.core.truth_("\ufdd0'else") ? cljs.core.str.call(null, "\ufdd0", "'", b)
: null; case 2: return a.call(null, cljs.core.str.call(null, b, "/", c)) }
throw"Invalid arity: " + arguments.length; }
cljs.core.keyword("hello")
":'hello"
"\ufdd0"
"�"
cljs.core.symbol_QMARK_("hello")
false
cljs.core.str("hello")
"hello"
cljs.core.str("\ufdd0")
":"
Cheers
Dave
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en