From: "Keith" <nono@joimail.net>
Subject: Array type conversion
Date: Thu, 17 Oct 2002 21:43:13 -0700
Date: 2002-10-17T21:43:13-07:00 [thread overview]
Message-ID: <aoo3h9$s7u$1@news.chatlink.com> (raw)
What is the implementation consequence of not following Ada reference
manual section 4.6 12/1 "The component subtypes shall statically match"?
What was the rational behind not allowing something like the following:
type some_type is new integer;
type A is array ( index_type) of integer;
type B is array ( index_type) of some_type;
Array_A:A;
Array_B:B;
declare
begin
Array_A:=A( Array_B);
end;
Rather than the legal but more cumbersome
for Index in index_type'range loop
Array_A(Index):=A(Array_B(Index));
end loop;
I know that if the component subtypes have to statically match in an array
conversion then there is no need to check for matching constraints at run
time like Ada 83. Does this speed up execution?
But
Array_A:=A( Array_B);
seems more inline with the spirit of Ada Array operations like A+B etc.
Thanks
--
Keith
next reply other threads:[~2002-10-18 4:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-18 4:43 Keith [this message]
2002-10-18 6:55 ` Array type conversion Jean-Pierre Rosen
2002-10-18 15:15 ` Robert A Duff
2002-10-19 3:27 ` Keith
2002-10-18 14:59 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox