[chuck-users] Object array initialization

Ollie Glass ollieglaskovik at gmail.com
Sat Jul 15 13:43:31 EDT 2006


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!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20060715/c5c4feb1/attachment.htm 


More information about the chuck-users mailing list