Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Polymorphic-copy/Common-Lisp/polymorphic-copy-1.lisp
Normal file
12
Task/Polymorphic-copy/Common-Lisp/polymorphic-copy-1.lisp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
(defstruct super foo)
|
||||
|
||||
(defstruct (sub (:include super)) bar)
|
||||
|
||||
(defgeneric frob (thing))
|
||||
|
||||
(defmethod frob ((super super))
|
||||
(format t "~&Super has foo = ~w." (super-foo super)))
|
||||
|
||||
(defmethod frob ((sub sub))
|
||||
(format t "~&Sub has foo = ~w, bar = ~w."
|
||||
(sub-foo sub) (sub-bar sub)))
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
(defmethod frob ((sequence sequence))
|
||||
(format t "~&sequence has ~w elements" (length sequence)))
|
||||
|
||||
(defmethod frob ((string string))
|
||||
(format t "~&the string has ~w elements" (length string)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue