Guile Mailing List Archive

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

Re: Is it OK to pass an SCM through (void *)?



Maciej Stachowiak <mstachow@mit.edu> writes:

> If you're passing it to gtk_signal_connect nothing guarantees it
> will stay on the stack.

Right.

> unless you do some extra tracking so you can unprotect it. This will
> result in memory leaks.

Right.

> I noticed that you were trying to provide some interfaces for the user
> to connect Scheme code to GUI elements. Why don't you just use
> guile-gtk for this purpose, since it deals with all the GC issues? I
> think it should be safe to embed it in gtk-based C apps with no extra
> worries (someone correct me if I'm wrong).

Well, the app was already written in C, and we're using SWIG to
provide bindings to the engine.  It's supposed to be a GNOME app, so
guile-gtk might not be the right thing.  I looked into gnome-guile,
but from what I could tell, it seems like it might be a little
immature.  Initially, I was just embedding guile in GnuCash to handle
some dynamic aspects.  Switching to gnome-guile would be a more
wholesale change, putting guile in primary control of everything.
While I'm perfectly happy with that, and would be perfectly happy to
see GnuCash be a Guile app with a C transaction and UI engine, and
while I have been migrating things in that direction anyway, I'm not
sure everyone else is ready for that kind of wholesale adoption...

-- 
Rob Browning <rlb@cs.utexas.edu> PGP=E80E0D04F521A094 532B97F5D64E3930

Guile Home | Main Index | Thread Index