comp.lang.ada
 help / color / mirror / Atom feed
From: porton@ex-code.com (Victor Porton)
Subject: Re: Let's change semantics of "use type"
Date: Tue, 12 Nov 2002 22:29:15 +0500
Date: 2002-11-12T17:33:13+00:00	[thread overview]
Message-ID: <3dd13b59$0$308$bed64819@news.gradwell.net> (raw)
In-Reply-To: 3dcb8347$0$299$bed64819@news.gradwell.net

In article <wccof8wuo5u.fsf@shell01.theworld.com>,
	Robert A Duff <bobduff@shell01.TheWorld.com> writes:
> porton@ex-code.com (Victor Porton) writes:
> 
>> "use all type" is namely against such the packages which contain 
>> something other among operations on a type and also against such
>> packages which define several types.
>> 
>> Consider also packages which define operations on class wide types.
>> "use"ing such a package may be dangerous as it may bring operations
>> on a not supposed concrete types.
> 
> I don't understand the problem.

package P is
  type A_Type is ...;
  
  procedure A(X: A_Type);
  
  procedure B(I: Integer);
end P;

"use"ing P would bring B which is likely to conflict or to "tempt".
(In real life B may be some procedure for incrementing erference
counter or like.)

>> Well, which dangers "use all type" has? Personally I when deal with
>> a type almost always want all its primitive operations. Getting all
>> primitive operations of a type seems nearly safe.
> 
> But when you deal with a type you also want various class-wide
> operations, and exceptions that are raised by primitive operations of
> the type, and generic units that are related to the type, and constants
> of the type.  In particular, you want everything related to the type.
> In other words, you want everything declared in the same package as the
> type.  Or, you want to use dot-selection notation.  These possibilities
> already exist.

Yes, I forgot about class wide operations; they also should be
brought to visibility by "use all type". Exceptions are commonly
not multiduous, so using a prefix notation or a rename isn't a
great problem with exceptions. Aproximately the same for constants.
Generic units are not overloadable, so these should also be not
brought to visibility, sorry for this.

"use all type" much shortens the list which we need to do manually
(without dangerous "use" directive).



  parent reply	other threads:[~2002-11-12 17:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-08  9:20 Let's change semantics of "use type" Victor Porton
2002-11-08 12:01 ` Adrian Hoe
2002-11-08 13:38 ` Robert A Duff
2002-11-08 20:52   ` Randy Brukardt
2002-11-08 18:12 ` Victor Porton
2002-11-09 15:20   ` Robert A Duff
2002-11-11  5:28 ` Victor Porton
2002-11-11 15:22   ` Robert A Duff
2002-11-11 15:59 ` Ted Dennison
2002-11-12  8:24   ` R. Tim Coslet
2002-11-12 15:39     ` Ted Dennison
2002-11-12 18:18       ` Preben Randhol
2002-11-12 17:29 ` Victor Porton [this message]
2002-11-12 17:32 ` Victor Porton
2002-11-18  1:25 ` Richard Riehle
2002-11-19  4:13 ` Victor Porton
replies disabled

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