As participants in this googlegroup have often observed, an excellent
way to learn Clojure is to study the source definitions of its API
functions. This advice works better for learners who know Java, which
I don't. I sometimes think that, if I were to teach a "Clojure
Programming" course, I would list a "Java Programming" course as a
prerequisite (for both teacher and students!). But here is some
Clojure.core source code that raises a problem for me which surely
doesn't have anything to do with not knowing Java.
user> (source list*)
(defn list*
"Creates a new list containing the items prepended to the rest, the
last of which will be treated as a sequence."
{:added "1.0"
:static true}
([args] (seq args))
([a args] (cons a args))
([a b args] (cons a (cons b args)))
([a b c args] (cons a (cons b (cons c args))))
([a b c d & more]
(cons a (cons b (cons c (cons d (spread more)))))))
--------------
What is the function _spread_? It is not in the Clojure API -- and the
definition of _list*_ seems to me to be complete without it.
--Larry
--
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