Yes, of course, thats what a sane person would do ;-)

I mentioned in my later post, this usage of symbols as data is 1. non-
idiomatic but 2. really illuminating for somebody with Java
background.
Well, and its what this tutorial does.

Nevertheless thank you for the answer!

Kind regards, alux


On 18 Mrz., 21:49, Brian Schlining <bschlin...@gmail.com> wrote:
> > But I have two translation problems, I want to pose before going to
> > sleep (its pitch dark in Europe :). First the easy one:
>
> > Common Lisp
> > (defun describe-path (path)
> >  `(there is a ,(second path) going ,(first path) from here.))
>
> > My Clojure version, I use a map:
> > (defn describe-path [path]
> >        (let [what (path :kind) where (path :direction)]
> >    (concat '(there is a) (list what) '(going) (list where) '(from
> > here.))))
>
> > Thats much less elegant. Is there a nicer way?
>
> It looks like you really want a formated string (concat returns a sequence
> not a string). You could use:
>
> (defn describe-path [path]
>     (format "this is a, %s, going, %s, from here" (path :kind) (path
> :direction)))
>
> --
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
> Brian Schlining

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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to