<div dir="ltr"><div><div>Thanks Martin, that's just what I'll do.<br><br></div>However, isn't the entire point of a groveler to build a little C program that gathers information like this for later use?  If one were to write a general purpose way to do this, wouldn't the logical place to put that code be in cffi-groveler?  Is the main hurdle here the fact that HUGE_VAL doesn't necessarily have a representation as a Lisp interger or double-float, the only two types that cvar allows?  Even though some of these sound a bit rhetorical, these are honest questions.<br>

<br></div><div>Zach<br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 26, 2013 at 8:25 AM, Martin Simmons <span dir="ltr"><<a href="mailto:martin@lispworks.com" target="_blank">martin@lispworks.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">>>>>> On Thu, 25 Apr 2013 20:55:38 -0600, Zach  said:<br>
><br>
> > (constant (+huge-val+ "HUGE_VAL") :type integer)<br>
> ><br>
> > then<br>
> ><br>
> > (with-foreign-object (huge-ptr :uint64)<br>
> >    (setf (mem-ref huge-ptr :uint64) +huge-val+)<br>
> >   (nlopt-set-lower-bound opts huge-ptr))<br>
><br>
> I have also been thinking along these lines.  The only thing I worry about<br>
> is whether this is strictly correct or just correct in practice.  Is there<br>
> a guarantee that a double float is always the same size as a uint64.  It's<br>
> true on every platform I have ever programmed for (I think), but will it<br>
> always be true?  Back when I programmed in C more often, hard coding data<br>
> type sizes into a program just seemed wrong so I didn't do it, so I guess I<br>
> wouldn't know.  Perhaps I am sweating a non-issue...<br>
<br>
</div></div>That's not the only problem -- on some platforms, HUGE_VAL is not a<br>
compile-time constant.  It looks like the only portable way to get the value<br>
is to write a C helper function to return it.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Martin Simmons<br>
LispWorks Ltd<br>
<a href="http://www.lispworks.com/" target="_blank">http://www.lispworks.com/</a><br>
<br>
</font></span></blockquote></div><br></div>