[chuck-users] Object array initialization

Ge Wang gewang at CS.Princeton.EDU
Sat Jul 15 21:36:10 EDT 2006


Hi Ollie,

This is a known bug: multiple declarations: int a, b; potentially 
causes incorrect behavior but it doesn't crash in all cases.
This will be fixed in the coming releases.

I've made a wiki page listing some known bugs, to reduce frustration 
and pain:

     http://wiki.cs.princeton.edu/index.php/ChucK/Bugs/Known

Best,
Ge!

On Jul 15, 2006, at 1:43 PM, Ollie Glass wrote:

> Hi Ge,
>
> your example works on my system too (OS X 10.4.7 PPC, ChucK 1.2.0.5b). 
> After some hacking I found the bus error stopped when I changed "int 
> rootNote, mainPitch;" to "int rootNote; int mainPitch;". I don't know 
> why, and strangely this test works:
>
> int x, y;
> 0 => x;
> 4 => y;
>
> <<< x >>>;
> <<< y >>>;
>
> If you'd like to recreate the error the offending variables are on 
> lines 459 & 460 in the script at blackholeprojector.com/Sequencer.ck
>
> Ollie
>
> On 14 Jul 2006, at 17:00, chuck-users-request at lists.cs.princeton.edu 
> wrote:
>
>> From: Ge Wang <gewang at CS.Princeton.EDU>
>> Date: 13 July 2006 17:36:16 BDT
>> To: ChucK Users Mailing List <chuck-users at lists.cs.princeton.edu>
>> Subject: Re: [chuck-users] Object array initialization
>> Reply-To: ChucK Users Mailing List 
>> <chuck-users at lists.cs.princeton.edu>
>>
>>
>> Hi Ollie!
>>
>> Which platform are you running? Also, can you include the
>> greater program, or more of the context? I can't seem to
>> reproduce the crash on OS X using the following code:
>>
>> ---
>>
>> public class X
>> {
>>   int hi;
>>   fun void boo()
>>   { <<< hi >>>; }
>> }
>>
>> class Y
>> {
>>   X xs[];
>>   init( 4 );
>>
>>   fun void init( int num )
>>   {
>>   X x[num] @=> xs;
>>
>>   for( int i; i < num; i++ )
>>   i => xs[i].hi;
>>   }
>> }
>>
>> // make y
>> Y y;
>>
>> // print
>> for( int i; i < y.xs.cap(); i++ )
>>   y.xs[i].boo();
>>
>> ---
>>
>> It may be a chuck bug elsewhere...
>>
>> Best,
>> Ge!
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users



More information about the chuck-users mailing list