[chuck-users] UGen based Pitch tracking demo (with BUG?)

Rogan Carr rogan.carr at gmail.com
Fri Jan 2 18:35:44 EST 2009


Kas says
> Can anybody think of a single instance where this could be useful at all?

I don't think so.  This sounds like a bug to me.  If there are two
declarations of the exact same function, for example your foo
functions, then chuck should at least warn you that you've overdefined
that function and tell you which version it will use.

Actually, as I type I can see one area where I might do this.  If you
have a class that inherits from another class, you may want to
redefine a function to do something different than its parent class.
For example.

public class Foo {
  0 => int bar;

  fun int getbar ( ) {
    return bar;
  }

}

class AlwaysOne extends Foo {

  fun int getbar () {
    return 1;
  }
}

This is a somewhat silly example, but I could see it being done and I
can't see why it should be illegal.  I do think it would be nice for
the VM to announce that it has been defined twice, and announce which
version would be used (the last to be declared, I would imagine).

Cheers, and Happy New Years!
Rogan


More information about the chuck-users mailing list