Subject: Re: call-next-next-method
From: Erik Naggum <erik@naggum.no>
Date: 1999/08/18
Newsgroups: comp.lang.lisp
Message-ID: <3143985782199982@naggum.no>

* Shiv <shiv@balrog.ece.ucsb.edu>
| I have made-up an artificial problem that hopefully reflects the
| essentials of my actual problem.
| 
| (defclass matrix ()
|   (...))
| 
| (defclass lower-triangular-matrix (matrix)
|   (...))
| 
| (defclass upper-triangular-matrix (matrix)
|   (...))
| 
| (defclass square-matrix (lower-triangular-matrix upper-triangular-matrix)
|   ())

  why not simply talk about the parts

(defclass square-matrix (matrix)
  ((lower-triangle :type lower-triangular-matrix)
   (upper-triangle :type upper-triangular-matrix)))

| It would be nice if I could say:
| 
| (defmethod mref ((A square-matrix) (i integer) (j integer))
|   (+ (call-next-method) (call-next-next-method)))

  why is the following the wrong solution?

(defmethod mref ((A square-matrix) (i integer) (j integer))
  (+ (mref (slot-value A 'lower-triangle) i j)
     (mref (slot-value A 'upper-triangle) i j)))

#:Erik
-- 
  (defun pringles (chips)
    (loop (pop chips)))