Clean up the documentation of defclass

This commit is contained in:
digikar99 2019-02-19 18:39:24 +05:30 committed by Kodi Arfer
parent ebcb374c1e
commit 247e64950d

View File

@ -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!")))