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,46295b30ce38047c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-04 06:31:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news-peer-europe.sprintlink.net!news.stupi.se!news01.chello.se!amsnews01.chello.com!cleanfeed.casema.net!leda.casema.net!bnewspeer01.bru.ops.eu.uu.net!bnewspost00.bru.ops.eu.uu.net!emea.uu.net!read.news.de.uu.net!not-for-mail Date: Wed, 04 Dec 2002 15:20:56 +0100 From: Ulrich Eckhardt Organization: Private at home User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.2.1) Gecko/20021130 X-Accept-Language: de, de-DE, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada Configuration API for Unix and Windows References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <903lsa-l91.ln@uli.uli-eckhardt.de> NNTP-Posting-Host: 2Cust11.tnt1.fft4.deu.da.uu.net X-Trace: 1039012304 read.news.de.uu.net 366 149.225.35.11 X-Complaints-To: abuse@de.uu.net Xref: archiver1.google.com comp.lang.ada:31418 Date: 2002-12-04T15:20:56+01:00 List-Id: Stephen Leake wrote: > Ulrich Eckhardt writes: >>I have decided to introduce special types for sections and values, >>so that the user can not accidentialy permute sections and keys or >>other unbounded strings, specialy when variables are used (and not >>simple string literals like in the example). > > That seems to make sense at first, but just gets in the way in the > long run. A string is a string. Named association is a better > solution. You can use named associations, but you don't have to use them. Also they do not prevent to use accidentialy a wrong variable. Assume you have some sort of ugly code like ak : Constant r_key := To_Key("A_Key"); as : Constant r_section := To_Section("A_Section"); .. Set_Section(reg,ak); Put(reg,as,"A Value"); Named association may not help in this case, since the user has accidentialy permutet the use of this variables. However, since i have extra types, the compiler will find this error. Of course, the above example is constructed, but sometimes you may have some complicated data structures lists etc ... Uli -- Ulrich Eckhardt http://www.uli-eckhardt.de