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 X-Google-Attributes: gid103376,public From: Craig Allen Subject: Re: Ada version of C's 'static' Date: 1999/07/30 Message-ID: <7nsuf3$tm9$1@nnrp1.deja.com>#1/1 X-Deja-AN: 506984436 References: <7n03us$862$1@nnrp1.deja.com> <3798EDE9.90B9623B@averstar.com> X-Http-Proxy: 1.0 x32.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: Fri Jul 30 19:29:54 1999 GMT X-MyDeja-Info: XMYDJUIDcpallen Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/3.01 (WinNT; I) Date: 1999-07-30T00:00:00+00:00 List-Id: In article <3798EDE9.90B9623B@averstar.com>, Tucker Taft wrote: > Craig Allen wrote: > > > > 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. > > Why do you believe it is regenerated? It shouldn't be if the > table is of compile-time known size with compile-time known values. > I was worried about this and I looked at the assembly created by the compiler. I believe that upon entry to the function, the table was regenerated every time even after making sure the data was constant. After implementing the inner package suggestion (thanks Dave) I again looked at the assembly output and this time it looked as if the table was not being generated upon entry. > If the values are known at compile-time, then any Ada compiler > worth its salt will allocate and initialize the table statically, > no matter where it is declared. If the compiler is not worth > its salt, then you probably have bigger problems anyway, so I wouldn't > worry about that contingency. Either that, or complain to/threaten > your compiler vendor ;-). I couldn't run my water softener off this compiler. Seriously, I'm using a VAX hosted Tartan 83 Ada compiler and do not enjoy it. Learning Ada is not easy when you must also question the compiler (cases of experienced people saying 'oh, we've had problems with that with the compiler, and so we just avoid doing it.') -Craig Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.