[Oberon] WITH removal in Oberon-07
Frans-Pieter Vonck
fp at vonck.nl
Wed Feb 20 18:09:05 CET 2013
> 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.
Hi Paul,
yes I was very impressed by it. I will check out your presentation for the
Oberon Day 2011 first before posting more questions.
http://www.multimedia.ethz.ch/conferences/2011/oberon/?doi=10.3930/ETHZ/AV-5879ee18-554a-4775-8292-3cf0293f5956&autostart=false
Greets,
Frans-Pieter
> [extracted from screeds of irrelevant repetitions of emails in the list
> digest!]
I
>
> 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
>
>
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
More information about the Oberon
mailing list