[Oberon] WITH removal in Oberon-07

Paul Reed paulreed at paddedcell.com
Wed Feb 20 13:05:15 CET 2013


> Date: Tue, 19 Feb 2013 22:13:01 +0100
> From: "Frans-Pieter Vonck" <fp at vonck.nl>
> Subject: Re: [Oberon] [Fwd: RE:  objects and jewels]

Hi Frans-Pieter,

> - WITH is not part of the Oberon07 language so that limits the use of
> procedure types. This implies that the message model of the Oberon System
> is not possible in Oberon07.
[extracted from screeds of irrelevant repetitions of emails in the list
digest!]

Respectfully, that's not true.  Although the regional type-guard (WITH)
has been abolished in Oberon-07, normal type-guards are certainly still
provided.

I have implemented the Oberon System in Oberon-07 (e.g. for Oberon Day
2011) and the number of changes to cope with the absence of WITH were
small.  I feel the code is actually more readable without WITH.

Looking at the examples either side of the section 11.2.3 heading on page
197 of Programming in Oberon (Reiser & Wirth 1992):

  IF p1 IS P2 THEN
    y2 := p1(P2)^; d2 := p1(P2).b
  END

I find more concise than

  IF p1 IS P2 THEN
    WITH p1: P2 DO
      y2 := p1^; d2 := p1.b
    END
  END

and I also don't like the latter because it changes p1 from the type of
its declaration.

It's always possible to declare a new variable with the guarded type if
the number of guards appears to be getting excessive, but ceteris paribus
I like the code to say what it's actually doing.

Cheers,
Paul





More information about the Oberon mailing list