[sorry for duplicating content from the email i sent you David]
Would anyone be interested in simplifying some of the boilerplate for
defining methods in clojs? Currently you have to do this,
(defclass circle [shape]
(:radius 10))
(defmulti area :tag)
(defmethod area ::circle [this] (* (:radius this) (:radius this) (Math/
PI)))
But it seems like 99% of the time this is boilerplate b/c you want
multi-methods to dispatch on :tag, so we should maybe have a shortcut
to let us do this...
(defclass circle [shape]
(:radius 10)
(defmethod area [] (* :radius :radius Math/PI)))
I'm not a macro-wiz but it must be possible to alter that defmethod to
check if it's defined and to wrap the symbol refrences with (:symbol
this) and cons this to the argument list.
Just a thought, Aria
On Jan 22, 7:55 pm, "
evins.mi...@gmail.com" <
evins.mi...@gmail.com>
wrote: