Rick Taube <taube@...> writes:
> I have a complete FFI to GTK2 for Darwin/OpenMCL, x86/CMUCL and
> x86/SBCL that I am releasing under the GNU copyleft agreement in the
> hopes that it may be of use to others in the Lisp community.
This is very cool. Thank you.
Firstly, you may be interested to learn that
perl -pi.bak -e 's/c-string/utf8-string/g' *.lisp
run in the source directory allows SBCL (from CVS) to pass strings
containing more characters than just ASCII to relevant functions: Zach
Beane provides a demonstration at
<http://www.xach.com/img/lambdagtk.png&gt; (I don't know how permanent
this URL is). I'm sure that that regexp substitution isn't the right
thing -- things which are explicitly *char should probably remain as
c-string -- but it's at least encouraging.
Secondly, I hope this encourages people on this list to think about
various useful things that should be added to SBCL in as maintainable
a form as possible: most obviously here we have callbacks, I suppose
(which I understand Thomas Burdick has working on x86/Linux,
ppc/Darwin and sparc/Solaris), but also to extend our linkage-table
implementation (currently working on x86 and sparc platforms). The
fact that Zach got a lambda into a button relatively easily is a good
sign, but it wouldn't surprise me to find that there are problems in
SBCL's handling of Unicode in foreign function calls, too.
In terms of the bindings themselves, I have only one comment, offered
more as food for thought than anything else. You currently generate
function names of the form GTK-FROB-BAR in the GTK package (and
G-SIGNAL-CONNECT and so on). One possible alternative to this (which
I tend to favour these days) is instead to generate names such as
FROB-BAR in the GTK package (and SIGNAL-CONNECT in the G package);
this is no more typing for the end user (who must use gtk:frob-bar
rather than gtk-frob-bar) but it reduces the chance of accidental name
collision: by explicitly _not_ using (in the Lisp USE-PACKAGE sense)
the GTK package, it is much harder for an application to clobber some
name of which the programmer was not aware.
I share the hope of another poster that the licence of the bindings be
made no more restrictive to the licensee than those of the gtk
libraries themselves -- but irrespective of your decision on this
issue, these bindings are a good spur to SBCL developers to improve
our functionality in this area, and let's hope to lisp developers in
general to write more programs.
Cheers,
Christophe

I have a complete FFI to GTK2 for Darwin/OpenMCL, x86/CMUCL and
x86/SBCL that I am releasing under the GNU copyleft agreement in the
hopes that it may be of use to others in the Lisp community. A short
overview, download links and installation instructions are at:
http://pinhead.music.uiuc.edu/~hkt/lgtk/lgtk.html
If you are interested in seeing what I'm using it for (including some
pretty pics in the Examples section) go to:
http://pinhead.music.uiuc.edu/~hkt/cm/doc/dict/plotter-topic.html
---
Rick Taube
Associate Professor, Composition/Theory
School of Music
University of Illinois
Urbana, IL 61821 USA
net: taube@...
fax: 217 244 8319
vox: 217 244 2684