[M3devel] language question -- locals uninitialized or zero?

Henning Thielemann lemming at henning-thielemann.de
Sun Feb 24 09:28:49 CET 2013


On Sun, 24 Feb 2013, Jay K wrote:

> PROCEDURE F1()
> VAR a, b := 1;
>     c: INTEGER;
>     t: TEXT;
>     r: TRACED REF...
>     u: UNTRACED REF...
> BEGIN
> END F1;
> 
> 
> 
> Is a defined? To 1 or 0?

1


"
   VAR v_1, ..., v_n: T := E

is shorthand for:
   VAR v_1: T := E; ...; VAR v_n: T := E
"

http://www.cs.purdue.edu/homes/hosking/m3/reference/variables.html


> Is c defined? 0?
> t? NIL?
> r? NIL?
> u? NIL?


"If E is omitted, the initial value is an arbitrary value of type T. If 
both are present,  E must be assignable to T."


More information about the M3devel mailing list