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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: Mats Weber Subject: Re: "<" operator Date: 1997/10/09 Message-ID: <343CE494.928C2F84@elca-matrix.ch>#1/1 X-Deja-AN: 278980795 References: <343A7434.36AD@newtimes.com> Organization: ELCA Matrix SA Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1997-10-09T00:00:00+00:00 List-Id: Assuming the guy wants lexicographic order (and wants the function to work with lists of different lengths), I think this should be corrected as follows: > function "<" > (L, R : Character_List) return Boolean is > begin > if L = null then > if R = null then > return True; should be return False; -- because you probably want ("" < "") = False > else > raise ; should be return True; -- because "" < anything > end if; > > elsif R = null then > raise ; should be return False; -- because anything > "" > else > return L.Item < R.Item and L.Next < R.Next; > > end if; > end;