[plt-scheme] Re: MysterX and arrays/vectors

From: Paul A. Steckler (stecksoft at gmail.com)
Date: Tue Mar 25 17:44:49 EDT 2008

On Tue, Mar 25, 2008 at 12:56 PM, Filipe Cabecinhas <filcab at gmail.com> wrote:
>  The problem is: When using COM objects, there's a difference between
>  using single and double values.
>  If I can't send (the other library) doubles, I must send it single
>  floats. But the library doesn't tell me it wants an array of doubles,
>  it says it wants any COM object (but, if I send it an array of
>  doubles, I get a COM exception), so I can't, in MysterX, decide to
>  send it an array of single-floats whenever the user passes a vector of
>  real numbers or every procedure that expects an array of doubles will
>  fail.

What might be nice is a Scheme function that offers a hint how to
convert Scheme data to COM-speak.  Something like:

  (as-com-type 'vt_r8 3.14)

would allow you to override the default marshalling.  Left as an exercise
for the reader. :-)

-- Paul

Posted on the users mailing list.