On Tue, Dec 30, 2008 at 4:29 PM, falcon <[email protected]> wrote:
>
> Generally speaking, how can I get information about my environment:
> -which bindings exist
> -the source code for a given function (if source code is available)
pmf's explanations are solid, but for the source code in particular,
you may be interested in clojure.contrib.repl-utils/source, which
allows interaction like:
user=> (source filter)
(defn filter
"Returns a lazy seq of the items in coll for which
(pred item) returns true. pred must be free of side-effects."
[pred coll]
(when (seq coll)
(if (pred (first coll))
(lazy-cons (first coll) (filter pred (rest coll)))
(recur pred (rest coll)))))
--Chouser
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---