Merge pull request #1750 from digikar99/master

added documentation for defclass docstring
This commit is contained in:
Kodi Arfer 2019-02-20 12:52:40 -05:00 committed by GitHub
commit 952ca3a727
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,7 +239,7 @@ as the user enters *k*.
comment comment
---- -------
The ``comment`` macro ignores its body and always expands to ``None``. The ``comment`` macro ignores its body and always expands to ``None``.
Unlike linewise comments, the body of the ``comment`` macro must Unlike linewise comments, the body of the ``comment`` macro must
@ -415,14 +415,16 @@ They can be used to assign multiple variables at once:
defclass defclass
-------- --------
New classes are declared with ``defclass``. It can takes two optional parameters: New classes are declared with ``defclass``. It can take three optional parameters in the following order:
a vector defining a possible super classes and another vector containing a list defining (a) possible super class(es), a string (:term:`py:docstring`) and another list containing
attributes of the new class as two item vectors. attributes of the new class along with their corresponding values.
.. code-block:: clj .. code-block:: clj
(defclass class-name [super-class-1 super-class-2] (defclass class-name [super-class-1 super-class-2]
[attribute value] "docstring"
[attribute1 value1
attribute2 value2]
(defn method [self] (print "hello!"))) (defn method [self] (print "hello!")))