[Openmcl-devel] Fwd: [info-mcl] Making C arrays in OpenMCL

Ron Garret ron at awun.net
Wed Apr 23 10:55:06 PDT 2008


On Apr 21, 2008, at 8:49 AM, Andrew Shalit wrote:

> Keith -- I'm glad to hear that your port is going well.  I'm taking  
> the liberty of forwarding your message to the OpenMCL-Devel e-mail  
> list, where it has more of a chance of being answered.
>
> Andrew
>
> Begin forwarded message:
>
>> From: "Keith L. Downing" <Keith.Downing at idi.ntnu.no>
>> Date: April 20, 2008 4:58:21 PM EDT
>> To: Discussion list for MCL users <info-mcl at clozure.com>
>> Subject: [info-mcl] Making C arrays in OpenMCL
>> Reply-To: Discussion list for MCL users <info-mcl at clozure.com>
>>
>> As part of my graphics conversion from MCL to OpenMCL (which is  
>> actually going quite well), I'm trying to
>> use a variety of line types: solid, dash, dash-dot, etc.  I declare  
>> each type as a CL global variable, which
>> then points to an object that houses, among other things, a pointer  
>> to a small C array that codes the
>> specification for the line type (as described in the "COCOA Drawing  
>> Guide" (pg. 75)).  It's the pointer to
>> this array that then gets passed to Objective C for drawing the  
>> line (as part of a Bezier curve).
>>
>> However, I'm having trouble creating these arrays in Objective C  
>> via the foreign-function interface.  My impression
>> is that make-heap-ivector will do this for me, and it does seem to  
>> work when the element-type argument
>> is '(unsigned-byte 64), for example.  But it doesn't seem to work  
>> when I use '(double-float 64).

That's because there's no such type as (double-float 64).  Try this:

Welcome to Clozure Common Lisp Version 1.2-r9233M-RC1  (DarwinX8664)!
? (make-heap-ivector 10 'single-float)
#(0.0 3.2539062 0.0 3.2773437 1.835429E+29 4.5916347E-41 1.8354169E+29  
4.5916347E-41 1.8230012E+29 4.5916347E-41)
#<A Foreign Pointer #xB90DF58>
40
? (make-heap-ivector 10 'double-float)
#(1.0D-323 2.964394D-318 6.953251193885D-310 0.0D0 0.0D0 0.0D0 0.0D0  
0.0D0 0.0D0 -2.0000000000000013D0)
#<A Foreign Pointer #xB9267A8>
80
?

rg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20080423/2b16e33d/attachment.htm>


More information about the Openmcl-devel mailing list