comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com (Robert Dewar)
Subject: Re: System.Address'Size - not a static integer expression?
Date: 22 Apr 2002 06:34:29 -0700
Date: 2002-04-22T13:34:29+00:00	[thread overview]
Message-ID: <5ee5b646.0204220534.54f73954@posting.google.com> (raw)
In-Reply-To: 7vlmbgks2a.fsf@vlinux.voxelvision.no

Ole-Hjalmar Kristensen <oleh@vlinux.voxelvision.no> 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.



  parent reply	other threads:[~2002-04-22 13:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-06 17:57 System.Address'Size - not a static integer expression? Vadim Godunko
2002-03-07  1:21 ` Robert Dewar
2002-03-07 13:56   ` Wes Groleau
2002-03-08 18:34     ` FGD
2002-03-08 19:07       ` Larry Kilgallen
2002-03-08 19:43       ` Wes Groleau
2002-04-08  4:57         ` Robert Dewar
2002-04-08 15:17           ` Wes Groleau
2002-04-10  1:54             ` Robert Dewar
2002-04-10 17:41               ` Wes Groleau
2002-04-10 18:29                 ` Darren New
2002-04-12 20:20                 ` Robert Dewar
2002-04-12 21:10                   ` Wes Groleau
2002-04-14 19:59                     ` Robert Dewar
2002-04-14 20:01                     ` Robert Dewar
2002-04-15 15:13                       ` Wes Groleau
2002-04-15 19:57                         ` Randy Brukardt
2002-04-17  3:22                           ` Robert Dewar
2002-04-17  3:11                         ` Robert Dewar
2002-04-17 18:27                           ` Wes Groleau
2002-04-19 14:06                             ` Robert Dewar
2002-04-19 15:05                               ` Wes Groleau
2002-04-20  2:26                                 ` Robert Dewar
2002-04-20  5:11                                 ` Robert Dewar
2002-04-20 16:50                                   ` Darren New
2002-04-22  9:20                                   ` Ole-Hjalmar Kristensen
2002-04-22 13:24                                     ` Robert Dewar
2002-04-22 13:59                                       ` Ole-Hjalmar Kristensen
2002-04-22 13:34                                     ` Robert Dewar [this message]
2002-04-22 14:02                                       ` Ole-Hjalmar Kristensen
2002-04-22 16:11                                         ` Jean-Pierre Rosen
2002-04-22 23:57                                         ` Robert Dewar
2002-04-08  0:43 ` Nick Roberts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox