[cffi-devel] Grovel float constants

Liam Healy lnp at healy.washington.dc.us
Fri May 29 02:51:57 UTC 2009


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: diff
Type: application/octet-stream
Size: 1200 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20090528/0a176a66/attachment.obj>


More information about the cffi-devel mailing list