I notice that in clojure.core some doc strings contain examples while
others don't. Specifically today I was checking on the arguments for
defmulti and defmethod, and given the doc strings it still isn't
entirely clear how to use them. For example, you have to know how a
fn-tail should look. In some doc strings there are minimal examples
of usage, such as require and some, which really helps to keep
plugging along when you're in the edit/repl/edit zone. Would patches
be accepted that add minimal examples to doc strings?
For example, (doc defmethod) could go from this:
--------
clojure.core/defmethod
([multifn dispatch-val & fn-tail])
Macro
Creates and installs a new method of multimethod associated with
dispatch-value.
--------
to something like this:
--------
clojure.core/defmethod
([multifn dispatch-val & fn-tail])
Macro
Creates and installs a new method of multimethod associated with
dispatch-value.
(defmethod area :rect
[shape]
(* (:width shape) (:height shape)))
--------
Cheers,
Jeff
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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