From: Ulrich Eckhardt <uli.e@gmx.de>
Subject: Re: Ada Configuration API for Unix and Windows
Date: Wed, 04 Dec 2002 15:20:56 +0100
Date: 2002-12-04T15:20:56+01:00 [thread overview]
Message-ID: <903lsa-l91.ln@uli.uli-eckhardt.de> (raw)
In-Reply-To: <u8yz5gahi.fsf@nasa.gov>
Stephen Leake wrote:
> Ulrich Eckhardt <uli.e@gmx.de> 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
next prev parent reply other threads:[~2002-12-04 14:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-03 16:47 Ada Configuration API for Unix and Windows Ulrich Eckhardt
2002-12-03 21:35 ` Stephen Leake
2002-12-03 22:29 ` Martin Dowie
2002-12-03 22:57 ` Stephen Leake
2002-12-04 13:09 ` Martin Dowie
2002-12-04 9:27 ` Ulrich Eckhardt
2002-12-04 13:49 ` Stephen Leake
2002-12-04 14:20 ` Ulrich Eckhardt [this message]
2002-12-05 8:43 ` Victor Porton
-- strict thread matches above, loose matches on Subject: below --
2002-12-05 6:10 Grein, Christoph
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox