[chuck-users] Sporking class member causes NullPointerException?

Ge Wang gewang at CS.Princeton.EDU
Wed Jun 28 17:07:07 EDT 2006


// Here is a work around for sporking member functions, ghastly but 
effectively.

class Test
{
     0 => int iz;

     fun void initTest()
     {
         while(true)
         {
             <<<iz>>>;
             ++iz;

             10::ms=>now;
         }
     }

     fun static void lame( Test test )
     {
         test.initTest();
     }

     spork ~ lame( this );
}

Test o;

while( true ) 1::second => now;


On Jun 28, 2006, at 4:48 PM, nitro2k01 wrote:

> On 6/28/06, Atte André Jensen <atte.jensen at gmail.com> wrote:
>> This is a known issue and I believe it's being worked on. For now (if
>> possible for what you want) declare initTest and iz as static:
>
> Well, the idea of putting things in a class is being able to have
> multiple instances, so I guess I'll skip the class definition for now
> until this gets fixed.
> Thanks anyway.
>
>                                                                    
> /nitro2k01
>
> -- 
> -----BEGIN 2ROT13 MESSAGE-----
> The blog  of nitro2k01: <http://soundandcomplete.wordpress.com/>
> Sätt på ett par flipflops, vippa på rumpan
> och gör det här till en minnesvärd sommar!
> -----END 2ROT13 MESSAGE-----
> _______________________________________________
> 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