guile-gtk-general
[Top][All Lists]
Advanced

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

Re: guile-gnome: %get-struct-slot


From: Andy Wingo
Subject: Re: guile-gnome: %get-struct-slot
Date: Sun, 15 Aug 2004 12:28:59 +0100
User-agent: Mutt/1.5.6+20040803i

On Sun, 08 Aug 2004, Andreas Rottmann wrote:

> Hi!
> 
> I just had a look at the metaclass code in gtype.scm, and wondered
> where %get-struct-slot and %set-struct-slot come from - they are used
> in (create-set-once-g-n-s class s class-slot?) and seem neither be
> part of Guile/GOOPS nor defined in guile-gnome anywhere. Is this dead
> code, so it never gets invoked, or is there some other magic involved
> here?

It's magical!

Seriously though, they're defined in gtype.c. grep -r is your friend :)

Come to think of it, they're essentially the same as
%fast-slot-{ref,set}, which are private to (oop goops). The only
difference is that fast-slot-ref will return SCM_UNBOUND if a slot is
unbound, whereas get-struct-slot will check for that and return #f. You
could probably do some trickery with unbound? (also private to (oop
goops)) to emulate the same code.

However, as it is, it's good to not muck about with GOOPS internals.

Cheers,
--
Andy Wingo <address@hidden>
http://ambient.2y.net/wingo/




reply via email to

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