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,10ed08559aef1b44 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-01 10:36:01 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: STATIC types in ADA? X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3C7FBFBC.FEC20446@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <3c7f8fd6$0$7055$43695faf@reader> Mime-Version: 1.0 Date: Fri, 1 Mar 2002 17:51:56 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:20662 Date: 2002-03-01T17:51:56+00:00 List-Id: jhuber@nlxcorp.ellsworth.com wrote: > > Do STATIC data types (like C++ has) exist in ADA? > > By this I mean, is there a way I can define a variable so that > when I call a procedure and set a value (say 5.0) and then > exit the procedure and come back into it at a later time, the > variable would still have the same value (i.e., 5.0)? In Ada such a variable (not a type) is considered to contain state information. State information is typically saved in variables in the same package body as the subprograms that manipulate the state. In multitasking situations (which don't arise in C++), state information is typically saved in a protected object and manipulated by the protected object's operations. -- Jeffrey Carter