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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c32f54b2230c68d7,start X-Google-Attributes: gid103376,public From: Craig Allen Subject: Ada version of C's 'static' Date: 1999/07/19 Message-ID: <7n03us$862$1@nnrp1.deja.com>#1/1 X-Deja-AN: 502839969 X-Http-Proxy: 1.0 x42.deja.com:80 (Squid/1.1.22) for client 130.181.134.191 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Mon Jul 19 21:05:43 1999 GMT X-MyDeja-Info: XMYDJUIDcpallen Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/3.01 (WinNT; I) Date: 1999-07-19T00:00:00+00:00 List-Id: I've written some code in a procedure that operates on a table of constants. The table is used only by that procedure. Right now, I have that table defined locally to that procedure. I believe the table is regenerated every time the procedure is called. In C, I'd declare this table static in that function. This would give me static duration and block scope for that function. I don't want to define this table at 'package scope', as only 1 procedure uses this table (and the values would be removed from the code that uses them). I would prefer not to build the table at elaboration time, because I'd like the definition to be close to the code that's using it, not at the bottom of the package. In short, this is exactly what I want, except in Ada. void foo(void) { static const int bar[] = {1, 2, 3, 4, 5}; ... } Or is there a 'more Ada' way of doing this? Thanks for any help. -Craig Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.