[Oberon] Life without local procedures

Jörg joerg.straube at iaeth.ch
Fri Feb 23 12:57:17 CET 2018

Personal style:
What I don't like with local procedures is the following:
As the local procedure(s) sit between the variable declaration and the
BEGIN, the local variable declarations are so far away from the BEGIN. I
don't like to scroll...


-----Original Message-----
From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of Chris
Sent: Friday, February 23, 2018 11:06 AM
To: 'ETH Oberon and related systems' <oberon at lists.inf.ethz.ch>
Subject: Re: [Oberon] Life without local procedures

> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Richard Hable
> Sent: Thursday, 22 February 2018 7:47 AM
> To: oberon at lists.inf.ethz.ch
> Subject: [Oberon] Life without local procedures
> Thus, my vote goes to keeping the support for local procedures in the
> Oberon compilers

I rarely (if ever) find a convincing need for local procedures in my own
code but I would not advocate removing them from Oberon. 

However, what I would be really interested to know is in what circumstances
you would *not* make a procedure local if it *could* be made local. Take for
example the compiler scanner module ORS in Project Oberon 2013. This has no
local procedures. In theory the following procedures could all be declared
local to procedure Get:


Furthermore, the procedure 'Ten' could be nested another level deeper within
procedure 'Number'. Would you have nested all of these procedures if you had
written that module? If not why not?

Similarly an example that puzzles me is procedure Scan in Module XRef in
section 21. Program Decomposition into Modules in the tutorial Programming
in Oberon:


Neither procedure 'heading' nor procedure 'copy' are marked for export. Both
are only called by procedure Scan. 'heading' is global but 'copy' is nested
within Scan. For the life of me I cannot see the difference. If one is
global why not the other one? Conversely, if one is nested why not the other
one? Is it just decided on a whim or am I missing something? 
Chris Burrows
CFB Software

Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems

More information about the Oberon mailing list