Guile Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating environments/frames ?
mcmanus@IDT.NET writes:
> > I want different C++ objects (with scheme embedded) to be linked by
> > C++ pointers. I want to access these other objects from the Scheme
> > code, and I want access to these pointers from C++.
>
> You can do this with a combination of smob's and primitive functions,
> though it may not be be exactly what you wanted. You would have one
> smob for each class in your application, and then you would write a
> primitive function that would return the objects that are linked to a
> base object.
And the smob and the C++ class are interlinked? Like
class Foo_class {
Foo_smob *smob_ptr_;
}
struct Foo_smob {
Foo_class *class_ptr_
}
> > (The reason for this, is that I want to do "reverse GC": I want to
> > remove an object, and have all references to it disappear
> > automagically)
>
> I'm not going to try to help you there; the only thought that comes to
> mind is that you should decide whether Scheme determines the lifetime
> of an object, or if C++ does. There are good strategies for dealing
> with both cases.
C++ determines life time, so what is the strategy?
--
Han-Wen Nienhuys, hanwen@cs.uu.nl ** GNU LilyPond - The Music Typesetter
http://www.cs.uu.nl/people/hanwen/lilypond/index.html
Guile Home |
Main Index |
Thread Index