Hi all,
I believe that the "public void announce" declaration should work if
it's the only instance of that function. I was declaring functions
like this a few years ago when I first started chuck (thinking that I
could make public and private functions).
Rogan
On Mon, Jan 25, 2010 at 3:03 AM, Hans Aberg
On 25 Jan 2010, at 06:56, Robert Poor wrote:
class Lunacy extends Trait { public void announce() { <<< "I am lunacy." >>>; } } (new Legacy).invoke(); (new Lunacy).invoke();
...
It took me a LONG time to find this one (and an even longer time to boil it down to a succinct example). Will the powers that be please take this as a request to beef up the parser?
The manual says that the P3-words (public, protected, private) are available, but not yet fully implemented.
But it is a good question as to why one can drop "fun" here.
It falls into the category of computer language quirks, or "gotchas" as they are called here: http://en.wikipedia.org/wiki/Gotcha_(programming)
It is a difficult topic. It's like older airplanes often had the flaps up and gears up controls side by side. When landing a plane one must look outside, and not at those controls. So every once in a while, a pilot would make a gears up instead of flaps up when on the ground, resulting in the need for an expensive repair. So modern airplanes usually don't have them side-by-side.
Hans
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users