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

From: Filipe Cabecinhas (filcab at gmail.com)
Date: Wed Mar 19 20:53:52 EDT 2008

Hi. Sorry for the late reply, but here it is.

On 5 Mar, 2008, at 20:36, Paul A. Steckler wrote:
>
> Here's what I'd suggest.  In plt/src/array.cxx, there's a function
> doSetArrayElements().
> In it, there's a call to marshalSchemeValueToVariant(), followed by  
> a call to
> SafeArrayPutElement().  You can write a function that pulls the COM  
> value out
> of the variant by dispatching on the vt (type) field, and pass that
> value, rather
> than the VARIANT, to SafeArrayPutElement().
>
> -- Paul


I tried that. I would see if all Scheme objects in the vector were of  
the same type (one can also do some coercions and have it more general  
but I didn't need it to right now. I just want it to work).
If they were all (for example) doubles, I would create a VT_R8  
SAFEARRAY and put them all there (with marshalSchemeValueToVariant + a  
helper function to take the pointer to what I wanted off the variant.  
Kind of a hack, but it should work).

But my code doesn't seem to be called. Is there some special magic I  
have to do, because of the 3M collector? I just opened the solution  
and started changing the files. I also changed com-method-type to  
return a pair for each argument so I could see if my code was running,  
but it just behaved the same way as before.

I'm changing the code, then running build.bat to create the new image.

I also tried making a small class to create COM Vectors (I only need 3  
elements in each vector) but the returned vector gets converted to a  
Scheme vector (which I like, btw) so I have the same problem.


Thanks for the reply

F


P.S (For the PLT people): Should I file a bug against the build  
process (scribble doesn't check the timestamps as the .zos compilation  
phase does) in the normal bug report form?



Posted on the users mailing list.