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: John McCabe Subject: Re: Enumeration literal visibility and use type Date: 1998/05/28 Message-ID: <6kj7av$qsn@gcsin3.geccs.gecm.com>#1/1 X-Deja-AN: 357239849 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: GMS&T Newsgroups: comp.lang.ada Date: 1998-05-28T00:00:00+00:00 List-Id: dewar@merv.cs.nyu.edu (Robert Dewar) wrote: >John McCabe says > ><>> > >If you think that explicit module qualifiers on identifiers are ugly, >then you definitely want to consider using a real "use" package clause. I have no real problem with that personally, and have done so on various occasions although obviously I have tried to restrict the scope of the use (package) clause as much as possible. >Basically what is going on with use type is that there are a significant >number of people who don't mind writing, or even prefer to write: > > package_name.identifier; > >and of course enumeration literals are just a special case of >identifiers. But they draw the line at > > 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). If Ada didn't allow the use of operators in this way, we would probably have to write a new function say package_name.sum(x,y) to perform this operation, but which wouldn't look anywhere near as blatantly unnatural. >I always have trouble understanding this distinction, but I *SURELY* <..snip..> >seems very inconsistent to me. I do understand the use type argument, >but surely to make it apply to enumeration literals and not other >primitive operations would be very odd indeed. I'm not sure what you mean here. Isn't it the primitive operations that it already applies to? If so, there is no suggestion of it being applied to only enumeration literals and not to the primitive operations. As far as I understand it, the question is why doesn't it apply to both? -- Best Regards John McCabe ===================================================================== Any opinions expressed are mine and based on my own experience. They should in no way be taken as the opinion of anyone I am currently working with, or of the company I am currently working for. If you have a problem with anything I say, SPEAK TO ME! (remove "nospam." to reply by e-mail) =====================================================================