Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
23
Task/Call-an-object-method/XLISP/call-an-object-method.xlisp
Normal file
23
Task/Call-an-object-method/XLISP/call-an-object-method.xlisp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
(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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue