informaticsEn 2022-07-19 11:27:34
324

How to define a method in Common Lisp?

All the instances of a class have the same  behavior.

Methods implement the behavior of instances.

Methods, defined with defmethod

(defmethod wizard ((object-of my-class)) 

;; do something )

You can get the example:

https://gist.github.com/juan-reynoso/3303c079dcd4297667acc267f52192d6

Further information about methods

https://gigamonkeys.com/book/object-reorientation-classes.html

https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node279.html#SECTION003216200000000000000

Back to index