Inheritance

Methods can be inherited from superclasses.


(dcircle (listobject (start    vector)
                     (diameter real))
prop    ((radius (diameter / 2)))
supers  (circle))

(gldefun t5 ((d dcircle)) (area d))

result type: REAL
(LAMBDA (D)
  (* 0.78539816339744828
     (EXPT (CADDR D) 2)))

(gldefun t6 ((d dcircle)) ((area d) = 100))

(LAMBDA (D)
  (SETF (CADDR D) 11.283791670955125)
  100)

An inherited method is compiled in the context of the inheriting object type; for example, when the area is inherited by a dcircle, it is complied in the context of a dcircle.

Contents    Page-10    Prev    Next    Page+10    Index