[Oberon] Oberon] initializing variable - was: Maintained open source Oberon/Oberon-2 compiler?
Douglas G. Danforth
danforth at greenwoodfarm.com
Wed May 14 22:39:01 CEST 2014
On 5/14/2014 12:46 AM, Treutwein Bernhard wrote:
>> If not, are declared variables initialized to a default value?
> as far as I know, this is deliberately unspecified.
From the component pascal documentation
"Local variables whose types are pointer types or procedure types are
initialized to NIL before the body of the procedure is executed"
"A module is a collection of declarations of constants, types,
variables, and procedures, together with a sequence of statements *for
the purpose of* assigning initial values to the variables."
"Variables declared in a module are cleared prior to the execution of
the module body. This implies that all pointer or procedure typed
variables are initialized to NIL"
That's it.
One nice thing about the MAINSAIL language was the concept that each
data type had a Zero and that all initial values of the data were Zero.
-Doug Danforth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/oberon/attachments/20140514/09141eff/attachment.html
More information about the Oberon
mailing list