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.4 required=5.0 tests=BAYES_50,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,199f758018fbe663 X-Google-Attributes: gid103376,public From: mmann@ibm.net (Gerd Moellmann) Subject: Re: private types and > Date: 1996/03/16 Message-ID: #1/1 X-Deja-AN: 142964451 distribution: world sender: mmann@ibm.net references: <4icphv$r59@mother.usf.edu> organization: None x-nntpdaemon: changi 0.9 for OS/2 newsgroups: comp.lang.ada Date: 1996-03-16T00:00:00+00:00 List-Id: kramer@suntan.eng.usf.edu (Todd Kramer (GE)) writes: > I was wondering if anyone out there could help me. I'm trying to write a > generic package to implement a doubly linked circular list. I wanted to > mak it sort based one of the data fileds in the records I am using but I > can't get it to let me compare directly since that operation is normally > not allowed on private types. I have tried sing function key_of to return > a key and then "<". However, it will not recognize this as a valid > operator either which my book says it should. Is there another way to do > this under gnat that is maybe nonstandard or something? If any of you > know PLEASE email me or drop me a reply. > > > thanks in advance > > TK Did you try something like this? generic type Element_Type is private; with function "<" (X, Y : in Element_Type) return Boolean is <>; package Sorted_List is ... end Sorted_List; -- Gerd Moellmann, Altenbergstr. 6, D-40235 Duesseldorf, Germany Software Development & Consulting Internet: mmann@ibm.net / CIS: 100025,3303 / Phone: +49 211 666 881