Welcome! Please see the About page for a little more info on how this works.

0 votes
in Docs by

I want to know what the characters mean on the second lines of entries on https://clojuredocs.org.

For example, head on over to https://clojuredocs.org/clojure.core/prn.

The first line of that page is:

prn

The second line is:

(prn & more)

What does (prn & more) mean? How do I interpret that? In particular, how do I interpret the ampersand &?

The notation used here reminds me of the "metalanguage" Augmented Backus-Naur form (https://en.wikipedia.org/wiki/Augmented_Backus–Naur_form), used to express the grammar of a programming language, and of the usage guidance often given by help entries for programs.

However, I don't see any documentation anywhere of how to interpret this particular metalanguage, if that's even what's going on here.

I am especially wondering how to interpret the &.

If there is a page somewhere explaining this, I wish it were linked from every entry on https://clojuredocs.org.

4 Answers

+1 vote
by
selected by
 
Best answer

ClojureDocs removes the outermost brackets when documenting function signatures. Not sure why - perhaps to avoid clutter. If you go to that web page for prn and click on "source" in the top right corner, you will see that its signature is [& more].

Regarding symbols - they're all documented on the Clojure website. In particular, & here means that the function is variadic: https://www.clojure.org/guides/learn/functions#_variadic_functions

+1 vote
by
0 votes
by
0 votes
by

clojuredocs.org's home page has a link, "Please open a ticket if you have an idea of how we can improve ClojureDocs".

Clojure's official (so to speak) API docs are at https://clojure.github.io/clojure/ (linked to by clojure.org).

I hope clojuredocs.org will thoughtfully incorporate your suggestion. The clojure.org docs tend strictly to separate orientation from reference.

...