From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b1208117d36fb121 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-22 06:34:29 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: System.Address'Size - not a static integer expression? Date: 22 Apr 2002 06:34:29 -0700 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0204220534.54f73954@posting.google.com> References: <665e587a.0203060957.3682edf7@posting.google.com> <5ee5b646.0204121220.606ecc36@posting.google.com> <3CB74D37.973A4C19@despammed.com> <5ee5b646.0204141201.1ffab2d8@posting.google.com> <3CBAEE01.D17C2DB0@despammed.com> <5ee5b646.0204161911.687f3144@posting.google.com> <3CBDBE76.F4FF3905@despammed.com> <5ee5b646.0204190606.4855f886@posting.google.com> <3CC03241.883A6E33@despammed.com> <5ee5b646.0204192111.1914353d@posting.google.com> <7vlmbgks2a.fsf@vlinux.voxelvision.no> NNTP-Posting-Host: 205.232.38.244 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1019482469 11481 127.0.0.1 (22 Apr 2002 13:34:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 22 Apr 2002 13:34:29 GMT Xref: archiver1.google.com comp.lang.ada:22904 Date: 2002-04-22T13:34:29+00:00 List-Id: Ole-Hjalmar Kristensen wrote in message news:<7vlmbgks2a.fsf@vlinux.voxelvision.no>... > dewar@gnat.com (Robert Dewar) writes: > Close, but no cigar :-) > I suggest you look up the keyword 'static' in the C standard. What I was referring to is the use of static for a local variable in a function as in: int x () { int y; static int z; ... z will be allocated statically, just like an OWN variable in Algol-60. This is certainly a useful capability in some form (and indeed we often see as an FAQ in CLA "is there an equivalent of static in Ada" [canonical answer "yes, use package body variables" [this actually should be "no, but you can use PB variables to get more or less the same effect -- the Ada approach lacks the semantics of the Algol-60 OWN or the C static in that the variable in question has a reach that is greater than the function, whereas in C/A60, the variable has a scope that is greater, but the reach is restricted. I use scope here to talk about the lifetime of the variable, and reach to refer to the places where it can be referenced. Yes, I know that the keyword static in C has other uses by extension, which indeed may be what Wes found confusing, but the above is the fundamental motivation for the choice of the keyword static in my view.