guile-devel
[Top][All Lists]
Advanced

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

How to implement 'class methods'


From: Andreas Rottmann
Subject: How to implement 'class methods'
Date: 01 Apr 2002 13:02:42 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi!

I wonder how one could implement 'class methods' (like C++ static
methods) in GOOPS. I'd like to call them like this:

(static-method <a-class> "argument")

where <a-class> would be the class the method belongs to.

I could use 

(define-method (a-method (<class> c) args) (do-something))

but this would get invoked for all calls that pass a class as first
argument and I'd have to test if the 'right' class is passed and then
use (next-method) if not.

Regards, Andy
-- 
Andreas Rottmann         | address@hidden        | address@hidden | 
address@hidden
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62



reply via email to

[Prev in Thread] Current Thread [Next in Thread]