On Mon, Aug 16, 2010 at 18:26, Andrew Gwozdziewycz <apg...@gmail.com> wrote:
> On Mon, Aug 16, 2010 at 3:34 AM, faenvie <fanny.aen...@gmx.de> wrote:
>> hi clojure-users,
>>
>> i wonder what the reason is, that clojure(-reader)
>> does not allow
>>
>> 1. multiline-strings like scala:
>>
>>  """this is a
>>   | multiline string"""
>
> Yes. It does, if you plug this into your repl (
>
> user=> (use '[clojure.contrib.str-utils2 :only [split-lines join]])
> user=> (defn ml-str
>  "Scala style multiline string"
>  [s]
>  (let [l (split-lines s)]
>   (join "\n" (map (fn [b]
>                    (let [i (.indexOf b "|")]
>                     (if (> i 0)
>                      (.substring b (inc i))
>                      b))) l))))
> #'user/ml-str
> user=> (ml-str "Hello Wo
>   |the margin will
>   |be deleted as per
>   |the request of scala
>   |users")
> "Hello World\nthe margin will\nbe deleted as per\nthe request of scala 
> \nusers"
> user=>

this, and my earlier rhetorical question about having this kind of
thing as a macro as produced: http://gist.github.com/527621

// Ben

-- 
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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to