comp.lang.ada
 help / color / mirror / Atom feed
From: "Michael F. Yoder" <yoder@decada.zko.dec.com>
Subject: Re: Elimination of "use" clauses
Date: 1999/07/21
Date: 1999-07-21T00:00:00+00:00	[thread overview]
Message-ID: <3795D51F.128F6658@decada.zko.dec.com> (raw)
In-Reply-To: wccvhbe9hpr.fsf@world.std.com

Robert A Duff wrote:
> Robert is fond of saying that style rules shouldn't be absolute.  Well,
> I usually agree, but here's one that I think really is absolute: Never,
> never use dotted notation in a function call if the function name is an
> operator symbol.  If you have something that really needs to be
> distinguished that carefully, then you shouldn't give it a name like
> "+".  Can anybody think of an example that shows I'm wrong?

How contrived and lame an example will you admit?  :-)

I'm pretty sure I have some black-box tests somewhere that work as
follows.  There's a package P to be tested that declares some
operators.  Within the black-box test, I declare a package Q that
contains identically named operators which implement exactly the same
functions; but these use crude and simple (and hopefully obviously
correct) methods.  Then the test contains code something like this:

   for <lots of values of L and R> loop
      Assert(P."+"(L, R) = Q."+"(L, R), "+ is wrong");
      Assert(P."-"(L, R) = Q."-"(L, R), "- is wrong");
      -- etc.
   end loop;

The selection notation is needed because the operators are homographs
and both are used at the same time.  Now if this weren't allowed I could
have made the operators in Q use a derived type, and added type
conversions at appropriate spots.  But I only thought of this method
because you were threatening to make it necessary.  :-)

-- 
----
Michael Yoder




  reply	other threads:[~1999-07-21  0:00 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-01  0:00 Elimination of "use" clauses Dr. Neil C. Audsley
1999-07-01  0:00 ` Joe Wisniewski
1999-07-01  0:00 ` czgrr
1999-07-01  0:00   ` Ted Dennison
1999-07-02  0:00     ` czgrr
1999-07-02  0:00       ` Ted Dennison
1999-07-01  0:00 ` Samuel T. Harris
1999-07-02  0:00 ` Robert Dewar
1999-07-02  0:00   ` Samuel T. Harris
1999-07-02  0:00     ` Robert Dewar
     [not found]       ` <7ltl2q$mog$1@nnrp1.deja.com>
1999-07-08  0:00         ` Michael F. Yoder
1999-07-09  0:00           ` Richard D Riehle
1999-07-09  0:00             ` Michael F. Yoder
1999-07-09  0:00             ` Marin David Condic
1999-07-09  0:00           ` Robert Dewar
1999-07-09  0:00             ` Dale Stanbrough
1999-07-12  0:00               ` Robert Dewar
1999-07-12  0:00                 ` Ted Dennison
1999-07-09  0:00             ` Michael F. Yoder
1999-07-14  0:00               ` Tucker Taft
1999-07-10  0:00             ` Simon Wright
1999-07-12  0:00               ` Robert Dewar
1999-07-08  0:00       ` R. Tim Coslet
1999-07-09  0:00         ` Robert Dewar
1999-07-09  0:00           ` tmoran
1999-07-02  0:00   ` Ted Dennison
1999-07-02  0:00     ` Stephen Leake
1999-07-02  0:00     ` Robert Dewar
     [not found]       ` <7ltus1$ah1@dfw-ixnews19.ix.netcom.com>
1999-07-13  0:00         ` Robert A Duff
1999-07-18  0:00           ` Richard D Riehle
1999-07-18  0:00             ` Dale Stanbrough
1999-07-20  0:00               ` Richard D Riehle
1999-07-19  0:00                 ` Brian Rogoff
1999-07-20  0:00                   ` Robert Dewar
1999-07-20  0:00                     ` Brian Rogoff
1999-07-21  0:00                       ` Ted Dennison
1999-07-21  0:00                         ` Robert A Duff
1999-07-21  0:00                         ` Robert Dewar
1999-07-21  0:00                       ` Robert Dewar
1999-07-21  0:00                         ` Brian Rogoff
1999-07-22  0:00                           ` Robert Dewar
1999-07-22  0:00                             ` Brian Rogoff
1999-07-22  0:00                           ` Robert Dewar
1999-07-22  0:00                             ` Brian Rogoff
1999-07-21  0:00                     ` Robert A Duff
1999-07-21  0:00                       ` Michael F. Yoder [this message]
1999-07-21  0:00                         ` Robert A Duff
1999-07-23  0:00                 ` Tucker Taft
1999-08-03  0:00                   ` Richard D Riehle
1999-07-20  0:00               ` David Kristola
1999-07-18  0:00             ` jerry
1999-07-19  0:00               ` Vladimir Olensky
1999-07-20  0:00               ` Richard D Riehle
1999-07-20  0:00                 ` Opaque Types (was Elimination of "use" clauses) David C. Hoos, Sr.
1999-07-20  0:00                 ` Elimination of "use" clauses jerry
1999-07-19  0:00             ` Ted Dennison
1999-07-19  0:00               ` Tucker Taft
1999-07-19  0:00                 ` Ted Dennison
1999-07-02  0:00     ` Ed Falis
1999-07-02  0:00   ` Ed Falis
1999-07-03  0:00     ` Joe Wisniewski
1999-07-03  0:00       ` Ed Falis
1999-07-03  0:00       ` Keith Thompson
1999-07-13  0:00     ` Peter Amey
replies disabled

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