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,4ee5611d3fbf05b7 X-Google-Attributes: gid103376,public From: Thomas Hood Subject: Re: Enumeration literal visibility and use type Date: 1998/05/28 Message-ID: <356D767E.41C6@ifn.com>#1/1 X-Deja-AN: 357309222 Content-Transfer-Encoding: 7bit References: <6kej65$dnh$1@hermes.seas.smu.edu| <6kejt5$75u@gcsin3.geccs.gecm.com> <6kensr$fqq$1@hermes.seas.smu.edu> <6kf0r3$isj$1@mulga.cs.mu.OZ.AU> <6kgh82$92n@gcsin3.geccs.gecm.com> <6kj7av$qsn@gcsin3.geccs.gecm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsabuse@supernews.com X-Trace: 896365813 UWZVVBCWS88AAD0D9C usenet85.supernews.com Organization: Internet Financial Network Newsgroups: comp.lang.ada Date: 1998-05-28T00:00:00+00:00 List-Id: John McCabe wrote: > > dewar@merv.cs.nyu.edu (Robert Dewar) wrote: > >John McCabe says > > > > package_name."+" (x,y); > > I believe it's simply to do with people's expectations. > > Naturally (well.. you know what I mean) we expect addition of 2 values to > be represented by x + y, and this is true of most High Level Languages > that I'm aware of, and C. Therefore it simply appears natural to prefer > to see x + y rather than package_name."+"(x,y). (Note: I believe that > both the package name and the ""s tend to distract the reader from the > meaning in these cases). My usual Ada83 way around this was to import the operator using a renames clause. i.e. function "+"(l,r : my_pkg.my_type) return my_pkg.my_type renames my_pkg."+"; This allows the infix use of the binary operator. It is still clumsy and not very pretty but it sure makes the body of the code read better. Thomas Hood thomas@ifn.com thomas@yachtrace.net