comp.lang.ada
 help / color / mirror / Atom feed
From: John McCabe <jgm@hayling.cwmbran.gecm.com>
Subject: Re: Enumeration literal visibility and use type
Date: 1998/05/28
Date: 1998-05-28T00:00:00+00:00	[thread overview]
Message-ID: <6kj7av$qsn@gcsin3.geccs.gecm.com> (raw)
In-Reply-To: dewar.896294335@merv


dewar@merv.cs.nyu.edu (Robert Dewar) wrote:
>John McCabe says
>
><<And explicit module qualifiers on enumeration literals don't?
>>>
>
>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
<john@nospam.assen.demon.co.uk>
=====================================================================
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)
=====================================================================






  reply	other threads:[~1998-05-28  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6kej65$dnh$1@hermes.seas.smu.edu| <6kejt5$75u@gcsin3.geccs.gecm.com>
1998-05-26  0:00 ` Enumeration literal visibility and use type William Bralick
1998-05-26  0:00   ` Fergus Henderson
1998-05-27  0:00     ` John McCabe
1998-05-27  0:00       ` Robert Dewar
1998-05-28  0:00         ` John McCabe [this message]
1998-05-28  0:00           ` Robert Dewar
1998-05-29  0:00             ` John McCabe
1998-05-28  0:00           ` Thomas Hood
1998-05-28  0:00             ` Robert Dewar
1998-05-27  0:00       ` Peter Amey
1998-05-27  0:00         ` John McCabe
1998-05-27  0:00     ` William Bralick
1998-05-26  0:00 William Bralick
1998-05-26  0:00 ` John McCabe
1998-05-26  0:00   ` David C. Hoos, Sr.
1998-05-26  0:00     ` Matthew Heaney
1998-05-27  0:00       ` John McCabe
1998-05-26  0:00     ` John English
1998-05-26  0:00     ` Ray Blaak
1998-05-27  0:00       ` John McCabe
1998-05-27  0:00         ` John McCabe
1998-05-27  0:00     ` Robert Dewar
1998-05-27  0:00       ` Matthew Heaney
1998-05-26  0:00 ` Roger Racine
1998-05-26  0:00 ` Matthew Heaney
1998-05-27  0:00   ` Mats Weber
1998-05-27  0:00   ` William Bralick
1998-05-27  0:00   ` John McCabe
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox