This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Marking smobs for GC



Hello all,

I'm working on an fltk (a c++ widget library) binding for guile, and
for the most part it's going fairly smoothly, but I have a few
questions regarding garbage collection.

Basically, through point of example I am doing this:

(define temp (fltk-window-new "Hello World" 200 400))
(use-this-window-in-my-program temp)
(define temp "Blah")

The "use-this-window-in-my-program" connects the structure in the smob 
to the gui.

But when I redefine the temp variable, that window is subject to
garbage collection. What I would like is that the window structure
and the smob associated with it persist.

It would be possible for me to traverse my gui and mark smobs
that might be attached at the beginning of garbage collection, but I
don't think there is any facility to do this(?).

If anyone has any ideas, alternatives or advice, I would appreciate
your input.

Another quick question -- the documentation "Data Representation in 
Guile" says that there are patterns of acceptable required and
optional parameters that can be passed to a function.  Are these
patterns documents, or does anyone know what they are?

Thanks!

-- 
James Dean Palmer                            Graduate Student
james@tiger-marmalade.com                    Visualization Sciences Program
http://www.tiger-marmalade.com/~james/       Texas A&M University