Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,19 @@
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;

View file

@ -0,0 +1,6 @@
;;; Initialize variables using default constructors
lvars instance1 = newPoint();
lvars instance2 = newCircle();
;;; Use print method
print(instance1);
print(instance2);