[chuck-users] Object array initialization
joerg at piringer.net
Sat Jul 15 10:49:16 EDT 2006
i was trying to reproduce the error and was not quite successful.
but i run into the following problem:
i am @=>ing a new object to an array and then trying to spork a member
function of that object array.
i get an array out of bounds exception when sporking. the assignment
see the attached script...
i think this is somehow related to the earlier problem.
Ge Wang wrote:
> Hi Joerg!
>> i also experienced problems with it that were solved when i declared
>> each element of the new array as a single variable and the @=> to the
>> instead of
>> obj o;
>> i had to write:
>> obj o1;
>> obj o2;
>> obj o3;
>> obj o4;
>> obj @ o;
>> o1 @=> o;
>> o2 @=> o;
> Is the offending declaration nested inside a class or function
> They seem to be working for me, so I suspect there might be other forces
> of chuck at work here.
> Another workaround, instead of declaring each element, you might try
> the new operator (though it could be subject to the same bug as above):
> obj @ o;
> for( int i; i < o.cap(); i++ )
> new obj @=> o[i];
> Sorry for the troublesome bug. We will take a deeper look into this.
> If you can pinpoint a demonstrative program (short as possible) that
> behaves incorrectly with these issues, it would help quite a bit.
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the chuck-users