clojure API documentation

64 views
Skip to first unread message

cej38

unread,
Jan 29, 2013, 12:42:26 PM1/29/13
to clo...@googlegroups.com
Hello,
  I have noticed a couple of things that I think are standard Clojure symbols but that aren't specified in the API documentation.  These are "." and "_".  It may be that they are more Java than Clojure (I don't know Java at all) and are thus supposedly known.  I run across "_" all of the time when reading though other people's code (especially core.logic) and I saw it again today when I was looking at the source code for drop-last.
  Should these symbols be added to the documentation?

  Also, could someone please give me a quick explanation of how to use _?

Thanks.

Stathis Sideris

unread,
Jan 29, 2013, 12:47:35 PM1/29/13
to clo...@googlegroups.com
_ is not special, but it is the convention to use it as the name for variables whose value is ignored.

Michael Gardner

unread,
Jan 29, 2013, 1:03:51 PM1/29/13
to clo...@googlegroups.com
On Jan 29, 2013, at 11:42 , cej38 <junke...@gmail.com> wrote:

> Should these symbols be added to the documentation?

The dot is documented at http://clojure.org/java_interop#dot -- which you'll be pointed to if you try (doc .) at a repl. It's also linked from http://clojure.org/special_forms.

It's not in the API docs because it's a special form (same as `if', for example). I think this is because the API docs are automatically generated and so don't know about special forms, only functions, macros, and vars.
Reply all
Reply to author
Forward
0 new messages