comp.lang.ada
 help / color / mirror / Atom feed
From: bmac3@ssc-bee.UUCP (Scott Pilet)
Subject: Re: Ada '88 musings
Date: Thu, 9-Jan-86 15:33:43 EST	[thread overview]
Date: Thu Jan  9 15:33:43 1986
Message-ID: <453@ssc-bee.UUCP> (raw)
In-Reply-To: 4700013@ada-uts.UUCP

>   3)  Extend identifier visibility rules to eliminate need
>       for most "use" clauses.
> 
> (3) is probably necessary for the upward-compatible
> implementation of (2), to give correct visibility
> characteristics to user-defined ":=".
> 
> The problem with (2) is that built-in ":=" is "directly" visible
> even when other implicitly defined operations (like "=") are not.
> To avoid forcing everybody to "use" the defining package
> of a limited type to get visibility on ":=" (or the horrendous
> pkg.":="(a, b)), we come to:
> 
> The implementation for (3):
> Add a third place to search for identifiers after consulting
> "direct" visibility and "use" visibility -- "defining-package"
> visibility.  Defining-package visibility would mean that
> after consulting the "use"d packages, each package in which
> the type of a parameter is defined is consulted for a subprogram/operator
> definition.  Note that the package of the result-type is NOT included.
> 
> In fact, if more than one package is represented among the types
> of the parameters, then it is guaranteed that at most one
> of them could have visibility to all of the parameter types,
> and hence only one of them could possibly provide a definition
> for the subprogram/operator.
> 
> For example:
>     x+y    Assume type of x is pkg_x.type_x and type of y is pkg_y.type_y
>            and pkg_y looks like this:
> 	   
>            with pkg_x;
> 	   package pkg_y is
> 	       type type_y is new integer;
> 	       function "+"(a:pkg_x.type_x; b:type_y) return type_y;
>            end pkg_y
> 
>    Then it should not be necessary to "use" pkg_y for Ada semantics
> to resolve "+" in x+y.
> This should eliminate most of the need for "use" clauses.
> 
> All of these ideas are half-baked, but we still have 2 years
> to finish the baking...
> 
> Tucker Taft
> Intermetrics, Inc.
> 733 Concord Ave
> Cambridge, MA  02138   (617) 661-1840

In a large system effort, some other programmer may have a package
with a y and a "+" that would allow x+y.  The lack of a "use" statement
adds to the complexity for debugging and sets the system up for a disaster
in the future.  The existence of a "use" statement may be nice for small
Ada programs, but in a large project the use of it may add to the confusion.
"with"ing and "rename"ing ensures that the software engineer is positive
of where an identifier is from and what it is.  More errors will be detected
by the software tools used by the engineers in a large software project
following this type of methodology.  As a tool to aid the software engineer,
a compiler message suggesting some resolution of an undefined identifier,
operator, or procedure (etc.) is helpful, but a compiler allowing ambiguities
that are technologically preventable can be disaster.

scott pilet
--these statements are my own and not Boeing's

  parent reply	other threads:[~1986-01-09 20:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1985-12-31 21:40 Ada '88 musings stt
1986-01-03 19:23 ` stt
1986-01-09 20:33 ` Scott Pilet [this message]
1986-01-20 17:47 ` Orphaned Response stt
  -- strict thread matches above, loose matches on Subject: below --
1986-01-02 20:44 Ada '88 musings Christopher Reedy
replies disabled

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