Commit Graph

5 Commits

Author SHA1 Message Date
Gergely Nagy
cbc2eed900
defclass reimagined
defclass now has a new syntax:

 (defclass Name [BaseList]
   [property value
    property value] ;; optional

   (defn method [self]
     self.property))

Anything after the optional property list (which will be translated to a
setv within the class context) will be added to the class body. This
allows one to have side effects and complex expressions within the class
definition.

As a side effect, defining methods is much more friendly now!

Closes #850.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-08-04 16:43:07 +02:00
Nathan Woodrow
41806895b2 Add macro expansion in defclass 2014-12-07 11:52:09 +10:00
Foxboron
66e3cdcb99 Rename slots to attribute/attr 2014-09-04 00:06:52 +02:00
Bob Tolbert
c42492ad84 Fix missing docstrings from defclass issue #248
Added ability to parse doc strings set in defclass declarations,
likei:

(defclass Foo [object]
  "this is the doc string"
  [[x 1]])
2013-07-15 06:58:08 -06:00
Julien Danjou
ad7e110af4 Implements defclass
This fixes issue #156

Signed-off-by: Julien Danjou <julien@danjou.info>
2013-05-08 12:38:57 +02:00