Re: converting a string to a list

2012-01-16 Thread Samuel Lê
Thanks for the answsers! Jay's last answer is just what I was looking for. thanks, Sam 2012/1/14 Jay Fields > this seems easier... > > user=> (map str "abc") > ("a" "b" "c") > > Though the original question says a list to a string and the example shows > a string to a list (of symbols) > > user

Re: converting a string to a list

2012-01-14 Thread Andy Fingerhut
This may not be important for your application, but if what you want in the returned sequence are strings, and if you expect to deal with Unicode characters that are not in the Basic Multilingual Plane (BMP) set, then note the following differences. (map str s) will return a separate string for ea

Re: converting a string to a list

2012-01-14 Thread Jay Fields
this seems easier... user=> (map str "abc") ("a" "b" "c") Though the original question says a list to a string and the example shows a string to a list (of symbols) user=> (apply str ["a" "b" "c"]) "abc' But, the example is looks like it wants user=> (map (comp symbol str) "abc") (a b c) Hop

Re: converting a string to a list

2012-01-14 Thread dennis zhuang
You can do this > ((comp #(map str %) seq) "abcdef") ("a" "b" "c" "d" "e" "f") 2012/1/15 Bruce Durling > Sam, > > Strings can be turned into sequences with seq. > > > (seq "foo") > (\f \o \o) > > The backslashes are because f o and o are character literals. > > cheers, > Bruce > > On Sat, Jan 14

Re: converting a string to a list

2012-01-14 Thread Bruce Durling
Sam, Strings can be turned into sequences with seq. > (seq "foo") (\f \o \o) The backslashes are because f o and o are character literals. cheers, Bruce On Sat, Jan 14, 2012 at 10:13, Samuel Lê wrote: > Hi, > > I was wondering if there was a function to convert a list into a string, > somethi

converting a string to a list

2012-01-14 Thread Samuel Lê
Hi, I was wondering if there was a function to convert a list into a string, something like: (string-to-list "abcde") ;; (a b c d e) thanks! Sam -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr