[cffi-devel] Grovel float constants

Liam Healy lnp at healy.washington.dc.us
Thu Jun 4 02:19:16 UTC 2009


With unified diff.

Liam

On Thu, May 28, 2009 at 10:51 PM, Liam Healy <lnp at healy.washington.dc.us> wrote:
> Never mind my previous patch, this one is better.
>
> Previously, in order to read double floats, I reset
> *read-default-float-format*, but that makes global changes, sometimes
> undesirable.  So instead, in this version, if the format is specified
> as "D", it will create a number that Lisp will read as double float.
> Otherwise the :format argument should be NIL or a C format
> string ("D" is unused in C).
>
> So for example
> (constant (+mksa-plancks-constant-h+ GSL_CONST_MKSA_PLANCKS_CONSTANT_H)
>          :format "D")
> becomes
> (cl:defconstant +mksa-plancks-constant-h+ 6.626069d-34)
>
> If the :format argument is not given or is nil, the expansion of constant
> should be identical to the original.
>
> Liam
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cffi-grovel.diff
Type: text/x-patch
Size: 1964 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20090603/855623f5/attachment.bin>


More information about the cffi-devel mailing list