<?xml version="1.0"?>
<paste-with-annotations>
  <paste>
    <number>
      <integer>83027</integer>
    </number>
    <user>
      <string>lnostdal</string>
    </user>
    <title>
      <string>simple oop and dispatch etc. with structs</string>
    </title>
    <contents>
      <string>SW-MVC&gt; (defstruct super 
          (x)
          (y))
SUPER
SW-MVC&gt; (defstruct (sub (:include super))
          (z))
SUB
SW-MVC&gt; (defmethod test ((obj super))
          (format t &quot;X: ~A, Y: ~A~%&quot; (super-x obj) (super-y obj)))
#&lt;STANDARD-METHOD TEST (SUPER) {ADFEC41}&gt;
SW-MVC&gt; (defmethod test ((obj sub))
          (format t &quot;X: ~A, Y: ~A, Z: ~A~%&quot; 
                  (super-x obj) (super-y obj) ;; SUB-X and SUB-Y would also work here.
                  (sub-z obj)))                   ;; But here we must use SUB-Z.
#&lt;STANDARD-METHOD TEST (SUB) {BF71C01}&gt;
SW-MVC&gt; (test (make-super :x 1 :y 2))
X: 1, Y: 2
NIL
SW-MVC&gt; (test (make-sub :x 1 :y 2 :z 3))
X: 1, Y: 2, Z: 3
NIL
SW-MVC&gt; </string>
    </contents>
    <universal-time>
      <integer>3455728992</integer>
    </universal-time>
    <channel>
      <string>None</string>
    </channel>
    <colorization-mode>
      <string>Common Lisp</string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <keyword>TRUE</keyword>
    </is-unicode>
    <deletion-requested>
      <null/>
    </deletion-requested>
    <deletion-requested-email>
      <null/>
    </deletion-requested-email>
    <expiration-time>
      <null/>
    </expiration-time>
  </paste>
</paste-with-annotations>
