[erlang-questions] Immutable isn't static Was: Re: Process scope variable
Richard A. O'Keefe
ok@REDACTED
Fri Mar 13 05:37:36 CET 2015
On 13/03/2015, at 10:59 am, Imants Cekusins <imantc@REDACTED> wrote:
> Computing (Of a process or variable) notable to be changed during a set period,for example while a program is running
>
> http://www.oxforddictionaries.com/definition/english/static
>
Guess what? Dictionaries contain errors.
If you trouble to look at the example sentences for that entry,
NOT ONE OF THEM IS TALKING ABOUT AN IMMUTABLE VARIABLE.
All of them are clearly using 'static' in the C|BCPL|PL/I sense
of unchanging *address*, not unchanging *contents*.
Sense 3, about electric charge, is clearly wrong.
Whether a charge is static or not depends on whether it
is *moving* or not, not whether it is on a non-conductive
body. It is quite commonplace to have a static charge on
a conductive object.
With my comments in brackets, the OED dictionary entry has
c. Computing. That cannot be changed while a program or operating system is running;
that must be specified, changed, or performed in advance of run time.
Cf. dynamic adj. and n. Additions.
[What makes a 'static variable' static is that the ADDRESS of the variable cannot be
changed.]
1957 Proc. 11th Western Joint Computer Conf. 44/1
The 60-word block of core storage serves as a static buffer
for information transferred between the computer and tape.
[This clearly refers to an *UNMOVING* block of storage whose *CONTENTS*
change very frequently.]
1973 Ann. Rev. Automatic Programming 7 103 We call this pointer the
static pointer, the pointer to the calling block being the dynamic pointer.
[For a long time we've called these static and dynamic LINKS, not static and
dynamic POINTERS. A static link in a procedure's frame refers to the frame
of the procedure that statically encloses the first one; the dynamic link
refers to the frame of the caller. This has nothing to do with immutable variables.]
2006 R. Hyde Write Great Code II. viii. 201 Because the lifetime of
a static variable matches that of the program, static variables
consume memory the entire time the program is running.
[And this one is precisely the C|BCPL|PL/I sense of a statically *allocated*
variable whose *contents* may be freely changed.]
More information about the erlang-questions
mailing list