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,f9cd205deb0d77f2 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: How can I qualify the predefined logical operations Date: 1998/07/19 Message-ID: <35B13A62.B113B73E@elca-matrix.ch>#1/1 X-Deja-AN: 372779103 Content-Transfer-Encoding: 7bit References: <6okcnl$n93$1@nnrp1.dejanews.com> <35AF1649.15FB@asrv01.atlas.de> Content-Type: text/plain; charset=us-ascii Organization: Swiss Online AG, Switzerland Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-07-19T00:00:00+00:00 List-Id: Andreas Kalla wrote: > What about this solution: > > function "And" (Left, Right: Private_Type) return Private_Type is > > Ret_Value : Private_Type := ( others => false ) ; > > begin > > for i in Private_Type'range > loop > Ret_Value ( i ) := Left ( i ) and Right ( i ) ; > end loop ; > > return Ret_Value ; > > end ; This is pretty bad because many compilers won't be able to optimize away the loop. Using the predefined "and" gives you much better chances in terms of efficiency, especially if the array type is packed.