def_interface() in object demo
[svn/Cll1h/.git] / demos / objects / objects-wiki.c
index f60351411f6ce528d41286ca3691c535b75ceb98..871488b2686ecdb89dc969b607ea63e6042cb0ef 100644 (file)
@@ -6,9 +6,7 @@
    Of course there are easier ways to do the same thing... :-) 
    (G)2008 xChas */
 
-def_type(Animal);
-
-def_mem(Actions)
+def_interface(Animal,Actions)
 {
  str method(talk) (Animal self);
 };
@@ -19,7 +17,7 @@ def_obj(Animal)
  char *name;
 };
 
-construct(Animal) (Animal self, str name)
+construct(Animal,Actions) (Animal self, str name)
 {
  self->name = name;
  return self;
@@ -70,6 +68,7 @@ program
 
  for_range(i, 0, 2)
  {
-  print(animal[i]->name, ":", _(talk,animal[i]));
+  print(animal[i]->name, ":", _(talk, animal[i]));
  }
+
 }
This page took 0.140042 seconds and 4 git commands to generate.