<< Back to previous view

[CLJS-162] cljs.core/str behavior not consistent with clojure Created: 15/Mar/12  Updated: 27/Jul/13  Resolved: 19/Mar/12

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Trivial
Reporter: Roman Gonzalez Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: bug
Environment:

This is the behavior on rhino repl, haven't tested on browser


Attachments: Text File CLJS-162_1.patch     Text File CLJS-162_2.patch     Text File CLJS-162.patch    

 Description   

When running the cljs.core/str function with symbols or keywords the output is not the same as in clojure

ClojureScript:cljs.user> (str "hello" :world)
"hello?'world"

The same happens with symbols, it seems the characters used internally for figuring out if a string is a keyword or symbol are not being escaped correctly on the cljs.core/str function.



 Comments   
Comment by Roman Gonzalez [ 15/Mar/12 9:18 PM ]

Added check of symbols and keywords on the private cljs.core/str* function

Comment by David Nolen [ 16/Mar/12 11:57 AM ]

The patch looks good but some tests fail now. Can you address that? Thanks!

Comment by Roman Gonzalez [ 16/Mar/12 11:55 PM ]

Thanks for checking this out David, I didn't read the developer wiki (my bad), I added a few tests and added a new small function that will allow both str* and str to behave correctly, cheers.

Note: Use CLJS-162_1.patch

Comment by Roman Gonzalez [ 19/Mar/12 5:45 PM ]

New patch which just replicates the StringBuffer code from `str*` into the `str` implementation.

Comment by David Nolen [ 19/Mar/12 9:25 PM ]

Fixed, https://github.com/clojure/clojurescript/commit/ec75a897fc7069176aff81e2df91b848c26af1c8

Generated at Wed Oct 01 01:29:31 CDT 2014 using JIRA 4.4#649-r158309.