From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,165d3eeae8b654b6 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: constant record components in Ada Date: 1997/06/27 Message-ID: #1/1 X-Deja-AN: 253057741 References: <5p100i$pvn@sutton.cs.columbia.edu> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-06-27T00:00:00+00:00 List-Id: A K asks <> The cleanest solution is to use a private extension so that Key_Type is a hidden field. If you want users to have read access to it, you can provide an appropriate access function. You can of course make the entire type private, and provide exactly the access you want in functional form as another alternative. If the specification of your type is precisely that any arbitrary change to Value_Type is OK, but no chanbge at all is valid to Key_Type, then it is true that the C++ notation is more convenient, but this is a very special case of the general issue of maintaining consistent data. Abstracting the data type is a much more general and usually preferable solution. We discussed during the Ada 9X design putting in a gizmo of this kind, and decided it was not worth the added complexity of this feature to provide a special syntax solution to a very limited case of the general problem of controlling consistent access to exposed data.