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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,627a173c3309b242 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 20 May 2004 22:07:08 -0500 Date: Thu, 20 May 2004 23:07:07 -0400 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Allocation of local constant arrays References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.90.114 X-Trace: sv3-C6L7PDobDgIH62Y+SgSO4/oHe1yhKWJC6tPZHjazXSkjNtGdkb0Ob3ioP1zcuz93XK5YuVtVjW+7RHN!7Rh1C9L8s97J6p3JJO2o4i0z2Mk0Xd9giqk6u35Y2qXzkVUNwuUIG8Fn4KdXyA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: controlnews3.google.com comp.lang.ada:726 Date: 2004-05-20T23:07:07-04:00 List-Id: Davide wrote: > As a general way to design the software, if you have constants used only by > a procedure, do you prefer (for the final application) to nest them in that > procedure or to keep them together with all the other constants in the > package body, then visible also to procedures not referencing them? > > The question, in other words, is: locate the data closest as possible to > operations who used them or tend to "globalize" their visibility also when > not necessary? > > Waiting for opinions. Never really thought about it. Usually if I am creating a library the constant arrays will be used by several functions, so of course I put them in the package body to have a single copy. As for "cut-points" in algorithms, usually these are named numbers in Ada terms. The compiler will normally put them into the code segment, so where they are allocated is not an issue. And I guess I like to have all the miscellanous cruft that needs a descriptive block comment in the area where the approach taken by the package as a whole is explained. -- Robert I. Eachus "The terrorists rejoice in the killing of the innocent, and have promised similar violence against Americans, against all free peoples, and against any Muslims who reject their ideology of murder. Their barbarism cannot be appeased, and their hatred cannot be satisfied. There's only one way to deal with terror: We must confront the enemy and stay on the offensive until these killers are defeated." -- George W. Bush