"Keith" a �crit dans le message news: aoo3h9$s7u$1@news.chatlink.com... > 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; > A derived type needs not have the same representation as its ancestor type. If the subtypes statically match, the compiler can perform a simple memory copy. Otherwise, the compiler must in effect generate the exact equivalent of the loop you give, and there is a deliberate decision in Ada to avoid, as far as possible, *hidden* inefficiencies. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr