Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
|
|
@ -0,0 +1,11 @@
|
|||
(* Abstract type *)
|
||||
Object = POINTER TO ABSTRACT RECORD END;
|
||||
|
||||
(* Integer inherits Object *)
|
||||
Integer = POINTER TO RECORD (Object)
|
||||
i: INTEGER
|
||||
END;
|
||||
(* Point inherits Object *)
|
||||
Point = POINTER TO RECORD (Object)
|
||||
x,y: REAL
|
||||
END;
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
(* Abstract method of Object *)
|
||||
PROCEDURE (dn: Object) Show*, NEW, ABSTRACT;
|
||||
|
||||
(* Implementation of the abstract method Show() in class Integer *)
|
||||
PROCEDURE (i: Integer) Show*;
|
||||
BEGIN
|
||||
StdLog.String("Integer(");StdLog.Int(i.i);StdLog.String(");");StdLog.Ln
|
||||
END Show;
|
||||
|
||||
(* Implementation of the abstract method Show() in class Point *)
|
||||
PROCEDURE (p: Point) Show*;
|
||||
BEGIN
|
||||
StdLog.String("Point(");StdLog.Real(p.x);StdLog.Char(',');
|
||||
StdLog.Real(p.y);StdLog.String(");");StdLog.Ln
|
||||
END Show;
|
||||
Loading…
Add table
Add a link
Reference in a new issue