"Yannick Duchêne (Hibou57)" wrote in message news:op.wwnp2zkrule2fv@cardamome... ... >I also looked at the RM about user-defined indexing, and could not find a >reason why it is legal for tagged types only. May be I will understand a >future day why it requires a tagged type, so far, it makes me feel it's >lacking orthogonality. It's simply a matter of practicality. We considered allowing them for all non-array types, but the problem is that you don't know whether a particular type is an array type unless you break privacy (a huge no-no for Legality Rules). And then you get into the problem of having both predefined and user-defined indexing for a particular type, and which one is used in a particular case. You can invent some really insane cases by using the "additional operation" rules (where indexing might only appear in the body or other very late points). Steve Baird had some head-exploding examples. We avoided the entire problem by only allowing this on tagged types, as there are no tagged array types. It's not a perfect solution, but its the most we could practically do for Ada 2012 (if this was any more complex, it would have been deep-sixed, that is, killed). As a practical matter, I think almost all new composite types ought to be derived from Controlled (or Limited_Controlled), meaning that they're tagged, so this restriction doesn't matter much. (The idea of indexing a numeric type is silly, array types don't need user-defined indexing, and nobody should be declaring visible access types anyway, so nothing is left.) YMMV. Randy.