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,9fe8e871f2090264,start X-Google-Attributes: gid103376,public From: "W. Wesley Groleau (Wes)" Subject: Is this correct? Date: 1996/05/02 Message-ID: <9605022151.AA12098@most>#1/1 X-Deja-AN: 152669839 sender: Ada programming language comments: Gated by NETNEWS@AUVM.AMERICAN.EDU content-type: text/plain x-url: http://www.acm.org/~bbalfour/Tips_No_1.html mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: NCSA Mosaic 2.7b1 on HP-UX Date: 1996-05-02T00:00:00+00:00 List-Id: I'm not saying where this comes from. If you know, please keep it to yourself and certainly don't flame the author. It seems to me that the following won't work. Or are the comments (all added by me) inaccurate? function "="(Left : Stack; Right : Stack) return Boolean is LC : Container_Pointer := Left.Head ; -- what if either RC : Container_Pointer := Right.Head ; -- is null before call? Equal : Boolean := True ; -- (caller gets exception) begin -- "=" loop Equal := LC.Value = RC.Value ; LC := LC.Next ; RC := RC.Next ; exit when (LC = null or RC = null) or not Equal ; -- I suspect a typo because parentheses are unnecessary -- If top three items are equal, but only Right has a fourth, then -- exit because LC = null and return True (incorrect). end loop ; return Equal ; end "=";