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

0 votes
in Docs by
The docstring for {{defn}} is:

bq. Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with any doc-string or attrs added to the var metadata. prepost-map defines a map with optional keys :pre and :post that contain collections of pre or post conditions.

The arglist is:

bq. (defn name doc-string? attr-map? [params*] prepost-map? body)

There are two issues that made this docstring hard to understand for me:

1. The docstring does not mention {{attr-map?}} -  it took me a a bit of jumping around the docs to make the leap from {{attr-map?}} to "with any [...] attrs added to the var metadata".
2. The docstring makes reference to {{exprs*}}, but the arglist refers to {{body}}.

5 Answers

0 votes
by

Comment made by: alexmiller

Patch welcome, would appreciate smallest change possible.

0 votes
by

Comment made by: marc

I've attached a patch to address two issues:

  • change 'exprs**' to 'body' to match the arglist.
  • change 'body+)' to 'body)+' when referring to the multi-artiy form.

I didn't address "any attrs" referring to attr-map, I wasn't sure the most "Clojury" way to phrase it.

0 votes
by

Comment made by: alexmiller

Seems like the body change is missing a trailing right paren?

You have: (def name (fn ((link: params ) body)+)
Should be: (def name (fn ((link: params
) body)+))

0 votes
by

Comment made by: alex+import

Hi @marc, any updates? It would be lovely to get this in :) Thanks!

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2211 (reported by marc)
...