String interpolation in ClojureScript

2013-02-08 Thread david
Why does ClojureScript support string interpolation for js* and not regular clojurescript strings? Interpolation would be very useful. (def x hi) (js* alert(~{x});) = hi (js/alert ~{x}) = ~{x} -- -- You received this message because you are subscribed to the Google Groups Clojure group

Re: String interpolation in ClojureScript

2013-02-08 Thread Jordan Berg
string interpolation for js* and not regular clojurescript strings? Interpolation would be very useful. (def x hi) (js* alert(~{x});) = hi (js/alert ~{x}) = ~{x} -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: String interpolation in ClojureScript

2013-02-08 Thread David Sargeant
to implement some operators and the interpolation helps there. I don't think js* is really meant to be used too much outside of core. Any reason to not just use str? (def x david) (str hello x) 2013/2/8 da...@dsargeant.com Why does ClojureScript support string interpolation for js

Re: String interpolation in ClojureScript

2013-02-08 Thread Jordan Berg
) 2013/2/8 da...@dsargeant.com Why does ClojureScript support string interpolation for js* and not regular clojurescript strings? Interpolation would be very useful. (def x hi) (js* alert(~{x});) = hi (js/alert ~{x}) = ~{x} -- -- You received this message because you are subscribed

Re: String interpolation in ClojureScript

2013-02-08 Thread Jordan Berg
* is used internally in cljs to implement some operators and the interpolation helps there. I don't think js* is really meant to be used too much outside of core. Any reason to not just use str? (def x david) (str hello x) 2013/2/8 da...@dsargeant.com Why does ClojureScript support string

Re: String interpolation in ClojureScript

2013-02-08 Thread David Sargeant
reason to not just use str? (def x david) (str hello x) 2013/2/8 da...@dsargeant.com Why does ClojureScript support string interpolation for js* and not regular clojurescript strings? Interpolation would be very useful. (def x hi) (js* alert(~{x});) = hi (js/alert ~{x}) = ~{x

Re: string interpolation

2010-11-21 Thread HiHeelHottie
Thanks Mike. This is what I was looking for. On Nov 20, 8:31 pm, Mike K mbk.li...@gmail.com wrote: Check out the macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- You received this message because you are subscribed to the Google Groups

Re: string interpolation

2010-11-21 Thread Rasmus Svensson
2010/11/21 HiHeelHottie hiheelhot...@gmail.com: I think ruby has nice string interpolation.  You can put the following in a textfield that a user can modify This is a #{adjective} string. Then, you can take that string, put it in quotes and have ruby evaluate it as a string.  What

string interpolation

2010-11-20 Thread HiHeelHottie
I think ruby has nice string interpolation. You can put the following in a textfield that a user can modify This is a #{adjective} string. Then, you can take that string, put it in quotes and have ruby evaluate it as a string. What is the clojure way of doing something similar. Presenting

Re: string interpolation

2010-11-20 Thread gaz jones
has nice string interpolation.  You can put the following in a textfield that a user can modify This is a #{adjective} string. Then, you can take that string, put it in quotes and have ruby evaluate it as a string.  What is the clojure way of doing something similar.  Presenting something like

Re: string interpolation

2010-11-20 Thread David Sletten
://www.gettingclojure.com/cookbook:sequences#commas Have all good days, David Sletten On Nov 20, 2010, at 6:00 PM, HiHeelHottie wrote: I think ruby has nice string interpolation. You can put the following in a textfield that a user can modify This is a #{adjective} string. Then, you can take

Re: string interpolation

2010-11-20 Thread Mike K
Check out the macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members

Re: string interpolation

2010-11-20 Thread Mike K
Check out the macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members

Re: string interpolation

2010-11-20 Thread Tom Faulhaber
Wow, David, that's a nice little demonstration of cl-format. I hadn't seen that before. But as Mike points out, clojure.contrib.strint/ is more precisely what the poster is asking for: true ruby-style string interpolation. It has occurred to me to extend cl-format to do real string interpolation

Re: string interpolation

2010-11-20 Thread Mike K
Check out the macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members

Re: string interpolation

2008-10-29 Thread Kyle R. Burton
Thanks for the macro. =) The str function is really a good replacement for interpolation. Yes, thank you for the macro. I anticipate using this approach (I'm accustomed to it from Ruby, Perl and JScheme), but wanted to support a way of stopping the parser (by backslashing the opening brace:

Re: string interpolation

2008-10-29 Thread Graham Fawcett
On Wed, Oct 29, 2008 at 1:27 PM, Kyle R. Burton [EMAIL PROTECTED] wrote: Thanks for the macro. =) The str function is really a good replacement for interpolation. Yes, thank you for the macro. I anticipate using this approach (I'm accustomed to it from Ruby, Perl and JScheme), but wanted

Re: string interpolation

2008-10-28 Thread Graham Fawcett
On Mon, Oct 27, 2008 at 11:38 PM, Islon [EMAIL PROTECTED] wrote: Is there any chance closure will get string interpolation? Do things like (prn Hi ${someone}, my name is ${myname}) is nice, not crucial of course, but nice. I'm personally not fond of string interpolation either. But for fun

Re: string interpolation

2008-10-28 Thread Graham Fawcett
On Tue, Oct 28, 2008 at 7:27 PM, Graham Fawcett [EMAIL PROTECTED] wrote: But for fun, here's an (i ...) macro, that will give you ${} interpolation in strings (if it works at all, I test it very thorougly!). Haha, nor did I spell- or grammar-check very thoroughly! I meant: I didn't test the