[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem with coerce and SWIG

John Fletcher

7/7/2003 12:38:00 PM

I am attempting to use coerce to be able to do calculations like

1 + x

where x is an object I have wrapped using SWIG. I use an STL vector to
return the objects to Ruby and a type mapping (typemap) within SWIG to
construct a Ruby array.

It all works fine except that the first item of the Ruby array loses its
value in the return process and Ruby receives a large integer which
looks like an address.

I have reported the full details on the SWIG list.

I am using SWIG 1.3.19 and Ruby 1.6.8.

Is this a known problem or have I found something new?

Thanks

John


1 Answer

John Fletcher

7/8/2003 12:17:00 PM

0



John Fletcher wrote:

> I am attempting to use coerce to be able to do calculations like
>
> 1 + x
>
> where x is an object I have wrapped using SWIG. I use an STL vector to
> return the objects to Ruby and a type mapping (typemap) within SWIG to
> construct a Ruby array.
>
> It all works fine except that the first item of the Ruby array loses its
> value in the return process and Ruby receives a large integer which
> looks like an address.
>
> I have reported the full details on the SWIG list.
>
> I am using SWIG 1.3.19 and Ruby 1.6.8.
>
> Is this a known problem or have I found something new?
>
> Thanks
>
> John

This problem is resolved an will be reported on the SWIG list.
The solution is in a better choice of the typemap.

John