[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

encapsulating a global variable (BlindAnagram)

On 2020-02-26, Chris Angelico <rosuav at> wrote:
> On Thu, Feb 27, 2020 at 9:45 AM Grant Edwards <grant.b.edwards at> wrote:
>> On 2020-02-25, Dennis Lee Bieber <wlfraed at> wrote:
>> > We seem to have some confusion with the use of the word "static"...
>> No doubt carrying on the tradition from C, where the 'static' keyword
>> is used to mean two completely different, orthogonal things.
> ... neither of which has anything to do with what a physicist would
> define "static" as.

I'm not sure what the physics usage of 'static' is, but when used for
local variables in C, it sort of makes sense: it means that the
location of the variable within the address space won't ever change
during the program's lifetime.  However, that's only half of what it
does in that context: it also means that the location won't be reused
for other things, and the location's contents will not change unless
it is "intentionally" written to by the program.

OTOH, the C usage of 'static' for file-scope variables is completely
off the wall.  I suspect somebody just put all of the existing
keywords that weren't yet valid in that context into a hat...

Grant Edwards               grant.b.edwards        Yow! Remember, in 2039,
                                  at               MOUSSE & PASTA will
                                be available ONLY by