[Oberon] objects and jewels

Frans-Pieter Vonck fp at vonck.nl
Mon Feb 18 22:30:44 CET 2013


Hi Oberoneurs,

I try to "reverse engineer" the arduino language in Oberon07.
In arduino speak you create an servo object like this:
<code>
Servo myservo;  // create servo object to control a servo

void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
</code>

In oberon(07) this would become something like:
MODULE Example
IMPORT SERVO;
VAR myservo : SERVO.servo;

BEGIN
  SERVO.Init(myservo,9)
END Example

I remember reading an argument of Wirth against object orientation. However
the object way, "myservo.atttach(9)" seems more elegant than the modular
way. Did I overlook something?

Greets,
Frans-Pieter









More information about the Oberon mailing list