[chuck-users] class confusion
Ge Wang
gewang at CS.Princeton.EDU
Mon Jul 10 18:47:13 EDT 2006
Hi Atte,
The example you provided reveals a bug in chuck: order of declaration
mattering when it should not. It's now noted to be fixed. Sorry for
the confusion.
Thanks!
Best,
Ge!
On Jul 8, 2006, at 6:24 PM, Atte André Jensen wrote:
> Hi
>
> Attached is a piece of useless code that confuses me. Should it matter
> where class kidA is defined? Is this a bug?
>
> --
> peace, love & harmony
> Atte
>
> http://www.atte.dk | quartet: http://www.anagrammer.dk
> http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
> class A{
> fun void greet(){
> <<<"hello">>>;
> }
> }
>
> // works when defined here
> //class kidA extends A {}
>
> class B{
> fun void greet(){
> }
> }
>
> class kidB extends B{
> 3 => int nb_kids;
> kidA kids[nb_kids];
>
> fun void greet(){
> for(0 => int i; i<kids.cap(); i++){
> kids[i].greet();
> }
> }
> }
>
> // doesn't work when defined here
> class kidA extends A {}
>
> /*
> A a;
> a.greet();
>
> kidA kid_a;
> kid_a.greet();
> */
>
> kidB kid_b;
> kid_b.greet();_______________________________________________
> 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