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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cef1968b544ddf26 X-Google-Attributes: gid103376,public From: Tom Moran Subject: Re: Static variables? Date: 1997/03/18 Message-ID: <332EBFCD.650@bix.com>#1/1 X-Deja-AN: 226500638 References: <332D71FF.4773@cae.ca> Organization: InterNex Information Services 1-800-595-3333 Reply-To: tmoran@bix.com Newsgroups: comp.lang.ada Date: 1997-03-18T00:00:00+00:00 List-Id: If the variable should really be private to a single function, like a C static variable inside a function, how about: package lots_of_things is ... procedure p_with_state; ... end lots_of_things; package body lots_of_things is ... package state_p is procedure actual_p; end state_p; package body state_p is static_variable : integer := 0; procedure actual_p is ... -- has access to static_variable end state_p; ... procedure p_with_state is begin state_p.actual_p; -- call the real p procedure to do its thing end p_with_state; ...