[chuck-users] "this" or "self" style keyword??

Atte André Jensen atte.jensen at gmail.com
Thu Jul 20 18:55:11 EDT 2006


q.h.r.h. wrote:

> sorry if I'm missing it. Is there a this/self style keyword for OO
> programming in classes?

If you want to access a member function or member data you can do I 
directly like this:

class test {

     int a;

     // this is part of init
     set_a(2);
     // this should print "2"
     <<<a>>>;

     fun void set_a(int new_a){
         new_a => a;
     }

}

test T;

If that's not what you're looking for, maybe you could elaborate a bit...

-- 
peace, love & harmony
Atte

http://www.atte.dk      | quartet:      http://www.anagrammer.dk
http://www.atte.dk/gps  | compositions: http://www.atte.dk/compositions


More information about the chuck-users mailing list