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,start X-Google-Attributes: gid103376,public From: Alexander V. Konstantinou Subject: constant record components in Ada Date: 1997/06/27 Message-ID: <5p100i$pvn@sutton.cs.columbia.edu>#1/1 X-Deja-AN: 253012219 Sender: akonstan@news.cs.columbia.edu Organization: Columbia University Department of Computer Science Newsgroups: comp.lang.ada Date: 1997-06-27T00:00:00+00:00 List-Id: I am trying to obtain in Ada (95) the same functionality of the C++ struct declaration : struct map_pair { const Key_Type first; Value_Type second; } The idea is to provide a record in which the key value is constant, and the value type is mutable. The Ada books I have looked at suggest using discriminants. Unfortunately, discriminants have to be either discrete or access types. In my case Key_Type is a generic parameter and restricting it to be a discrete type is too restrictive. On the other hand, making the discriminant a pointer is in my view an ugly solution since it keeps that extra pointer around. Any ideas on how to tackle this ? Alexander V. Konstantinou -- Alexander V. Konstantinou http://www.cs.columbia.edu/~akonstan/ akonstan@cs.columbia.edu akonstan@acm.org