guile-devel
[Top][All Lists]
Advanced

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

Re: How to implement 'class methods'


From: Neil Jerram
Subject: Re: How to implement 'class methods'
Date: 01 Apr 2002 15:47:43 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "Andreas" == Andreas Rottmann <address@hidden> writes:

    Andreas> Andreas Rottmann <address@hidden> writes:
    >> 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.
    >> 
    Andreas> Oops, this one should rather go to -user. CC'd.

I don't think this is supported yet.

I think the right way to do it would be to add `eql' specializers to
GOOPS.

        Neil




reply via email to

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