Subject: [clisp-list] call-next-method problem

From: Milan Zamazal <[email-masked]>
Date: 11 Oct 2000 20:41:51 +0200

In CLISP, call-next-method is a macro and not a function, which is a
documented feature.  This causes some problem to me and I don't know how
to solve it cleanly.

In ANSI Common Lisp, I can do the following:

 (defclass foo ()
   ((z :initarg :z)
    (bar :initarg :bar)))

 (defmethod initialize-instance ((instance foo) &rest initargs &key x y)
   (if (and x y)
     (apply #'call-next-method instance :z (sqrt (+ (* x x) (* y y))) initargs)
     (call-next-method)))

I don't know how to perform the `apply' call in CLISP.  Is it possible
by some trick or can I use another approach to the class instance
initialization, which is not worse than using the initialize-instance
method?

Thanks for any advice.

Milan Zamazal

-- 
"Having GNU Emacs is like having a dragon's cave of treasures."
                                                Robert J. Chassell

---

From: Bruno Haible <[email-masked]>
Date: Wed, 11 Oct 2000 21:10:31 +0200 (CEST)

>      (apply #'call-next-method instance :z (sqrt (+ (* x x) (* y y))) initargs)

This is fixed in the newest clisp snapshots, e.g.
   ftp://cellar.goems.com/pub/clisp/clisp-snap.tgz

> by some trick

I don't think so.

Bruno

---

From: Reini Urban <[email-masked]>
Date: Thu, 12 Oct 2000 14:07:50 +0200

> initialization, which is not worse than using the initialize-instance

as long as there are no lexvars involved I would do:
  (eval (list 'call-next-method instance :z (sqrt (+ (* x x) (* y y)))
initargs))
-- 
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html