Hey Clojurians,

I'm a Clojure and Common Lisp newbie. I heard that Norvig's PAIP was a
good book to study idiomatic CL code, so I've embarked on a project to
translate the examples to / work the exercises in Clojure.  I hope to
complete this project before the end of this century :-)

Regarding "append" from CL: ISTM that this is similar to "concat" in
Clojure.  I tried the following definition:

(defn append [& parts] (concat parts))

but it is not quite correct:

(concat '(a b c) '(d e f) '(g))

-> (a b c d e f g)

(append '(a b c) '(d e f) '(g))

-> ((a b c) (d e f) (g))

What is the correct way to do this?  Is it possible to code the idea
that append == concat two ways, one explicitly defining a parameter
list like "parts" and one just aliasing the concat symbol somehow?

Also, is the following definition closer to the CL semantics?

(use '[clojure.contrib.seq-utils :only (flatten)])
(defn append2 [& parts] (flatten (list parts)))

(append2 '((a) b c) '(d e f) '() '(g))

-> (a b c d e f g)

Finally, can anyone recommend a good free common lisp implementation
that runs well with slime / emacs under Windows?

   Thanks,
   Mike

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