comp.lang.ada
 help / color / mirror / Atom feed
* Array type conversion
@ 2002-10-18  4:43 Keith
  2002-10-18  6:55 ` Jean-Pierre Rosen
  2002-10-18 14:59 ` Robert A Duff
  0 siblings, 2 replies; 5+ messages in thread
From: Keith @ 2002-10-18  4:43 UTC (permalink / 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






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-19  3:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-18  4:43 Array type conversion Keith
2002-10-18  6:55 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox