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,ba92fa04d48e3ba0 X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: "<" operator Date: 1997/10/07 Message-ID: #1/1 X-Deja-AN: 279194354 References: <343A7434.36AD@newtimes.com> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-10-07T00:00:00+00:00 List-Id: In article <343A7434.36AD@newtimes.com>, dperez wrote: >how can I write a recursive Ada Function "<" that does the less-than >comparison on linked lists of characters to do the obvious thing? function "<" (L, R : Character_List) return Boolean is begin if L = null then if R = null then return True; else raise ; end if; elsif R = null then raise ; else return L.Item < R.Item and L.Next < R.Next; end if; end; Won't that do it? The type is type Character_List_Node; type Character_List is access Character_List_Node; type Character_List_Node is record Item : Character; Next : Character_List; end record; function "<" (L, R : Character_List) return Boolean; -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271