Related articles |
---|
static declarations & accessibility ihnp4!wucs1!wuibc2!brown (1987-12-13) |
Re: static declarations & accessibility rsalz@bbn.com (1987-12-15) |
Re: static declarations & accessibility wucs1!wuibc2!brown@uunet.UU.NET (1987-12-20) |
Return-Path: | <brown@wuibc2> |
Date: | Sun, 20 Dec 87 14:54:47 CST |
From: | wucs1!wuibc2!brown@uunet.UU.NET (Michael Brown) |
Newsgroups: | comp.compilers |
In-Reply-To: | <792@ima.ISC.COM> |
References: | <785@ima.ISC.COM> |
Organization: | Washington University |
Cc: |
In reply to my earlier posting, <792@ima.ISC.COM> Rich Salz states:
> Not a good argument: it's overruled by the semantics of pointers, and
.
.
.
> Anyhow, the ANSI X3J11 C standardization committee invented (okay, stole
> from C++) the "const" keyword for just that sort of thing. It's similar
> to the VMS C "readonly" storage-class. Check out a copy of the draft
> for more info.
> [Similar comments received from several other readers. -John]
I wasn't clear enough. I don't interpret the modifier "static" as meaning
read only but that the declaration is *hidden* from references outside of the
scope of the declaration.
The motivation for the original question was that if a declaration
is meant to be hidden then why not allow optional runtime protection to force
an error if the hidden declaration is accidentally/un-intentionally referenced
from outside of the context of the declaration.
I recognize that the static modifier has other uses in addition to
information hiding.
Regards,
Mike Brown Institute for Biomedical Computing
Washington Univ., St. Louis, MO
(314) 362-2135
[Not a bad idea, but isn't it really just a special case of pointer checking,
e.g. ensuring that array subscripts point into an array, that a pointer to
foo is really pointing to a foo, and so forth. Hard to do unless you're
interpreting everything, though. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.