[gambit-list] more fun with c-ffi

lowly coder lowlycoder at huoyanjinjing.com
Mon Feb 16 17:40:19 EST 2009


looking at the glut ffi at the dumping grounds, we have lines like:

(define GL_NORMAL_ARRAY #x8075)
(define GL_COLOR_ARRAY #x8076)
(define GL_INDEX_ARRAY #x8077)
(define GL_TEXTURE_COORD_ARRAY #x8078)

this is really cool because ... now, in scheme land, I also know the values
of these defines

suppose however, I didn't care about the values of these globals in scheme
land ... and suppose, i'm writing the ffi for naother library and I don't
want to manually (or write a script) to get the value of each of these
constants, is there anyway I can do something like:

(c-define-foreign-varaible gl_normal_array "GL_NORMAL_ARRAY")

and have gl_normal_array (only in compiled mode, I recognize this will fail
in interpted mode) just get expanded to "GL_NORMAL_ARRAY" during
compilation?

thanks!

(I also dislike the eralier method in that ... if API changes causes the
global vars to have different values ... i'll have lots of fun with silent
var value changes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090216/5ed4a4bd/attachment.htm>


More information about the Gambit-list mailing list