Introduction to OOP Chapter 4: Classes and Methods: next previous audio real text

Methods without Classes in Oberon

Oberon does not have classes, per se, but allows methods to be defined as a funny type of function:

TYPE
	PlayingCard = POINTER TO PlayingCardDesc;

	PlayingCardDesc = RECORD
		suit : INTEGER;
		rank : INTEGER;
		faceUp: BOOLEAN;
	END

PROCEDURE (aCard: PlayingCard) setFaceUp (b : BOOLEAN);
BEGIN
	aCard.faceUp = b;
END

Intro OOP, Chapter 4, Slide 27