2010/11/21 HiHeelHottie <[email protected]>:
>
> 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 something like
>
> "This is a " adjective " string"
>
> and then wrapping that in (str ) before evaluating it in clojure seems
> less attractive.
>

There's also the String/format wrapper in clojure.core, which can be
used for simpler interpolations (you can use usual printf directives):

    (format "This is a %s string" adjective)

// raek

-- 
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

Reply via email to