[Oberon] The Extended WHILE Statement

Michael Schierl schierlm at gmx.de
Wed May 20 22:45:21 CEST 2026


Hello,

Am 20.05.2026 um 01:45 schrieb Chris Burrows:
> A new language feature introduced in Oberon-07, and implemented in the 
> Astrobe compilers is the Extended WHILE (aka the /Djikstra WHILE/) 
> statement.
> 
> I am curious to know if any of you have used it in an application. 

I mostly used it when lazily porting "infinite" loops with an EXIT 
statement from older Oberon versions to Oberon-07. Many of them 
naturally match the WHILE-ELSIF, therefore saving a temporary boolean 
variable as well as an extra nesting level (or a larger refactoring).


In  my own code, so far, I can only recall using it to iterate over used 
slots in a sparse double-indirect (or triple-indirect) data structure. 
WHILE is to skip over unused slots in the first link level, and each 
ELSIF skips over unused slots of the second or third link level.


It appears I only used it once in code published on my GitHub (when I 
can trust my regexp-Fu to find relevant ELSIF .* DO lines):

<https://github.com/schierlm/Oberon2013Modifications/blob/1fdae9020f85f445c0b719d7b739300fe54950b2/UnicodeFontIndex/UnicodeFontIndex.Mod.txt#L61>

But other examples of this pattern I found lying on my hard disk are 
substantially identical to this example anyway.


Regards,


Michael



More information about the Oberon mailing list