Re: String interpolation in ClojureScript

2013-02-08 Thread David Sargeant
gt; much outside of core. Any reason to not just use str? >> >> (def x "david") >> >> (str "hello " x) >> >> >> 2013/2/8 >> Why does ClojureScript support string interpolation for js* and not regular >> clojurescript stri

Re: String interpolation in ClojureScript

2013-02-08 Thread Jordan Berg
wrote: >> >> js* 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") >

Re: String interpolation in ClojureScript

2013-02-08 Thread Jordan Berg
"david") > > (str "hello " x) > > > 2013/2/8 > >> Why does ClojureScript support string interpolation for js* and not >> regular clojurescript strings? Interpolation would be very useful. >> >> (def x "hi") >> >>

Re: String interpolation in ClojureScript

2013-02-08 Thread David Sargeant
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 > Why do

Re: String interpolation in ClojureScript

2013-02-08 Thread Jordan Berg
js* 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 > Why does

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

Re: string interpolation

2010-11-21 Thread Rasmus Svensson
2010/11/21 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.  Wh

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 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 "Clojure" group. To p

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 membe

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 t

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 membe

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 membe

Re: string interpolation

2010-11-20 Thread David Sletten
ial plus links here: http://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

Re: string interpolation

2010-11-20 Thread gaz jones
you could use format or cl-format? http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/format http://clojure.github.com/clojure-contrib/pprint-api.html#clojure.contrib.pprint/cl-format On Sat, Nov 20, 2010 at 5:00 PM, HiHeelHottie wrote: > > I think ruby has nice

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

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

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 islon
Thanks for the macro. =) The str function is really a good replacement for interpolation. On Oct 28, 8:29 pm, "Graham Fawcett" <[EMAIL PROTECTED]> wrote: > 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 $

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

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

Re: string interpolation

2008-10-28 Thread Mike Benfield
I've always preferred a function like str to either of these options anyway. (str "Hi " someone ", my name is " myname) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: string interpolation

2008-10-28 Thread mb
Hi Islon, On 28 Okt., 04:38, 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. There is format. user=> (def someo

string interpolation

2008-10-28 Thread Islon
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. Islon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo