I'd say that it is C that confused static with constant.

> Humans would think of static data as being constant (at least constant once 
> loaded).
> "Writeable static" is, to me, an oxymoron.


"Static" is just one of the terms used with computing that is being used with 
different meanings. When I started to work on IBM mainframes in 83, the first 
language I go taught was PL/I. PL/I distinguishes between "static" and 
"dynamic" storage for variables.


Storage for static variables, i.e. variables declared with the STATIC keyword, 
is "allocated" in the so called static CSECT that becomes part of the object 
module. Note that this *is* read/write storage, so in PL/I STATIC does not mean 
constant.


Storage for dynamic variables will be allocated at run time.


PL/I did not have constants until the advent of Enterprise PL/I. You define a 
constant by defining its value via VALUE() keyword instead of the usual 
INITIAL() keyword.


Also new with Enterprise PL/I is the ASSIGNABLE/NONASSIGNABLE attribute for 
variables. So, STATIC as well as dynamic variables can be writable or not (i.e. 
constant after being initialized).

--
Peter Hunkeler

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to