X-Git-Url: http://nitlanguage.org diff --git a/examples/callback_monkey.nit b/examples/callback_monkey.nit index 074df9f..6e1ed26 100644 --- a/examples/callback_monkey.nit +++ b/examples/callback_monkey.nit @@ -58,7 +58,7 @@ interface MonkeyActionCallable end # Defining my object type Monkey, which is, in a low level, a pointer to a C struct (CMonkey) -extern Monkey `{ CMonkey * `} +extern class Monkey `{ CMonkey * `} new `{ CMonkey *monkey = malloc( sizeof(CMonkey) ); @@ -69,7 +69,7 @@ extern Monkey `{ CMonkey * `} # Object method which will get a callback in wokeUp method, defined in MonkeyActionCallable interface # Must be defined as Nit/C method because of C call inside - fun wokeUpAction( toCall: MonkeyActionCallable, message: Object ) is extern import MonkeyActionCallable::wokeUp `{ + fun wokeUpAction( toCall: MonkeyActionCallable, message: Object ) is extern import MonkeyActionCallable.wokeUp `{ // Allocating memory to keep reference of received parameters : // - Object receiver