[Oberon] Initial value of variables, where specified?

rochus.keller at bluewin.ch rochus.keller at bluewin.ch
Wed Feb 12 16:04:27 CET 2020


@  Chris Burrows

Thank you very much for your response. Meanwhile I also found an example of a module level variable which is used before explicit initialization: e.g. nextCh in TextFrames.Mod where the first test "nextCh # CR" in procedure DisplayLine was non-deterministic if nextCh were not automatically initialized.

Best
R.


_______________________________
From: Chris Burrows
Sent on: Wed, 12 Feb 2020 02:06:12 +0100
To: ETH Oberon and related systems
Cc: 
Subject: Re: [Oberon] Initial value of variables, where specified?

The value a variable is supposed to have before it is explicitly assigned a
value is not defined in the latest Oberon Language Report.

In Project Oberon dynamic variables are initialised to zero when they are
allocated by NEW. The relevant code is in Kernel.New:

WHILE p < lim DO SYSTEM.PUT(p, 0); INC(p, 4) END

Regards,
Chris Burrows
CFB Software
https://www.astrobe.com


More information about the Oberon mailing list