[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call-method ??????



How about:

(defclass boat ...)

(defmethod move-on-sea ((x boat) ...)

(defmethod move-in-air ((x boat) ...) (error ...)

(defclass plane ...)

(defmethod move-on-sea ((x plane) ...) (error ...)

(defmethod move-in-air ((x plane) ...)

(defclass hydroplane (boat plane) ...)

(defmethod move ((x hydroplane) on-sea?)
  (if on-sea?
    (move-on-sea x...)
    (move-in-air x...)))

     Daniel.