<div>Here's how Marc does it in his Xlib.scm example :</div><div><br></div><div>(define GCFunction</div><div>  ((c-lambda () unsigned-long "___result = GCFunction;")))</div><div><br></div><div>(define GCPlaneMask</div>
<div>  ((c-lambda () unsigned-long "___result = GCPlaneMask;")))</div><div><br></div><div>(define GCForeground</div><div>  ((c-lambda () unsigned-long "___result = GCForeground;")))</div><div><br></div>
<div>(define GCBackground</div><div>  ((c-lambda () unsigned-long "___result = GCBackground;")))</div><div><br></div><div>(define GCLineWidth</div><div>  ((c-lambda () unsigned-long "___result = GCLineWidth;")))</div>
<div><br></div><br><div class="gmail_quote">On Mon, Feb 16, 2009 at 5:40 PM, lowly coder <span dir="ltr"><<a href="mailto:lowlycoder@huoyanjinjing.com">lowlycoder@huoyanjinjing.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
looking at the glut ffi at the dumping grounds, we have lines like:<br><br>(define GL_NORMAL_ARRAY #x8075)<br>(define GL_COLOR_ARRAY #x8076)<br>(define GL_INDEX_ARRAY #x8077)<br>(define GL_TEXTURE_COORD_ARRAY #x8078)<br><br>

this is really cool because ... now, in scheme land, I also know the values of these defines<br><br>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:<br>

<br>(c-define-foreign-varaible gl_normal_array "GL_NORMAL_ARRAY")<br><br>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?<br>

<br>thanks!<br><br>(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<br>
<br>_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
<br></blockquote></div><br>