20 lines
382 B
Plaintext
20 lines
382 B
Plaintext
uses objectclass;
|
|
define :class Point;
|
|
slot x = 0;
|
|
slot y = 0;
|
|
enddefine;
|
|
|
|
define :class Circle;
|
|
slot x = 0;
|
|
slot y = 0;
|
|
slot r = 1;
|
|
enddefine;
|
|
|
|
define :method print(p : Point);
|
|
printf('Point(' >< x(p) >< ', ' >< y(p) >< ')\n');
|
|
enddefine;
|
|
|
|
define :method print(p : Circle);
|
|
printf('Circle(' >< x(p) >< ', ' >< y(p) >< ', ' >< r(p) >< ')\n');
|
|
enddefine;
|