In object-oriented programming a method is a function associated with a particular class or object. In most forms of object oriented implementations methods can be static, associated with the class itself; or instance, associated with an instance of a class.

Show how to call a static or class method, and an instance method of a class.

(DEFINE-CLASS MY-CLASS)
 
(DEFINE-CLASS-METHOD (MY-CLASS 'DO-SOMETHING-WITH SOME-PARAMETER)
    (DISPLAY "I am the class -- ")
    (DISPLAY SELF)
    (NEWLINE)
    (DISPLAY "You sent me the parameter ")
    (DISPLAY SOME-PARAMETER)
    (NEWLINE))
 
(DEFINE-METHOD (MY-CLASS 'DO-SOMETHING-WITH SOME-PARAMETER)
    (DISPLAY "I am an instance of the class --  ")
    (DISPLAY SELF)
    (NEWLINE)
    (DISPLAY "You sent me the parameter ")
    (DISPLAY SOME-PARAMETER)
    (NEWLINE))
 
(MY-CLASS 'DO-SOMETHING-WITH 'FOO)
 
(DEFINE MY-INSTANCE (MY-CLASS 'NEW))
 
(MY-INSTANCE 'DO-SOMETHING-WITH 'BAR)