From: "Grein, Christoph" <christoph.grein@eurocopter.com>
Subject: Re: Ada Configuration API for Unix and Windows
Date: Thu, 5 Dec 2002 07:10:08 +0100 (MET)
Date: 2002-12-05T07:10:08+01:00 [thread overview]
Message-ID: <mailman.1039069081.6868.comp.lang.ada@ada.eu.org> (raw)
> > > Put(reg,To_Key("A_Key"),"A Value"); -- A Key in the default section
> > > Why is the conversion To_Key necessary? Surely it could be done by
> > > Put?
> >
> > 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.
declare
-- type T is new String; or alternatively
type T is array (Positive range <>) of Character;
procedure P (L: T; R: String) is
begin
null;
end P;
begin
P ("AAA", "BBB"); -- legal
P (T'("AAA"), "BBB"); -- legal
P (T("AAA"), "BBB"); -- illegal (type of "AAA" can not be determined)
end;
So again: Why is the conversion necessary?
next reply other threads:[~2002-12-05 6:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-05 6:10 Grein, Christoph [this message]
-- strict thread matches above, loose matches on Subject: below --
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
2002-12-05 8:43 ` Victor Porton
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox