2

I'm new to Clojure, and I would like to know where is all the documentation for all the libraries such as those found on clojars.org?

For example using lein I do the following to the project.clj

(defproject Program-name "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :dependencies [[org.clojure/clojure "1.3.0"]
   [facts/speech-synthesis "1.0.0"]
[org.clojars.jeffsigmon/maryclient "4.3.0"]
[speech-synthesis "1.0.0"]
[clarity "0.5.6"]])

then uselein deps to install all the libraries

Core.clj

(ns Program-name.core
(:use [speech-synthesis.say :as say])(use [clarity.component]))
(use 'clarity.form)

so how would I import and get the API information for org.clojars.jeffsigmon/maryclient?

note: I read that that the API documentation is stored in the libraries and you have to import them to access it

2 Answers 2

3

The API docs are in the code in the form of docstrings

e.g.

(defn my-func
 "This is the doc string"
 [a b c]
   ...)

You can access the doc strings in the REPL:

$ lein repl
user> (doc println)
-------------------------
clojure.core/println
([& more])
  Same as print followed by (newline)

user> (apropos "print")
(*print-radix* *print-miser-width* *print-pprint-dispatch* print-table 
  print-length-loop pprint-indent pprint *print-suppress-namespaces* 
  *print-right-margin* *print-pretty* with-pprint-dispatch ...)

user> (find-doc "print")
... lots of functions related to print with docs...

Various IDEs also give access to the docs. e.g. in emacs, with swank you can use slime-describe-symbol accessed via the shortcut C-c C-d d

Sign up to request clarification or add additional context in comments.

Comments

2

use doc, find-doc, apropos function on REPL, use lein repl start a repl.
BTW: if the library jar is not include .clj files, you cannot use them.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.