From: Robert A Duff <bobduff@world.std.com>
Subject: Re: 'with'ing and 'use'ing
Date: 2000/02/29
Date: 2000-02-29T00:00:00+00:00 [thread overview]
Message-ID: <wcc900324d1.fsf@world.std.com> (raw)
In-Reply-To: yoxzosjx5o1.fsf@dymock.dra.hmg.gb
rh@signal.dera.gov.uk (Roger Hoyle) writes:
> 1) Is this basically a good idea? It seems sensible to me, but then I know
> little about Ada. (I'm asking about generally not 'use'ing stuff, not
> specifically my current situation)
You've just started a language war between the two dialects of Ada --
the use-phobes and the use-philes. ;-)
And then there's the folks who advocate renaming all packages as
incomprehensible abbreviations, so you can say XQYBC.Grind_Upon_List. ;-)
I slightly prefer using use clauses.
Of course, you don't have much choice -- the existing code doesn't use
use, so presumably the names were chosen with that in mind.
> the operators (=,/=,>=,<=) etc for some of the types in the main
> package. The only way I seem to be able to get access to these operators
> is to 'use' the package. Is this right, or am I missing somehting?
This is a trick used in Ada 83 to avoid use-visibility for identifiers,
but still allow the operators to be directly visible. (While saying
``Foo.Bar(X, Y)'' might be reasonable, saying ``Foo."+"(X, Y)'' is an
abomination.) Yes, you need to say "use Whatever.Ops;" for this trick
to work. The trick is no longer needed in Ada 95 -- use "use type"
instead.
The trick is a little bit dangerous, because the code in the Ops package
is so boring that the reader assumes it says the obvious, without
reading it carefully. I remember spending some time tracking down a bug
caused by saying something like ``function "xor"(...) renames "and";''
-- a cut-and-paste error.
- Bob
next prev parent reply other threads:[~2000-02-29 0:00 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-29 0:00 'with'ing and 'use'ing Roger Hoyle
2000-02-29 0:00 ` Jeffrey Carter
2000-02-29 0:00 ` Brian Rogoff
2000-03-01 0:00 ` Jean-Pierre Rosen
2000-03-02 0:00 ` Charles Hixson
2000-03-02 0:00 ` Robert A Duff
2000-03-02 0:00 ` Ted Dennison
2000-03-02 0:00 ` Charles Hixson
2000-03-02 0:00 ` David Starner
2000-03-03 0:00 ` Jeff Carter
2000-03-03 0:00 ` David Starner
2000-03-04 0:00 ` Simon Wright
2000-03-03 0:00 ` Ted Dennison
2000-03-07 0:00 ` Nick Roberts
2000-03-03 0:00 ` Marin D. Condic
2000-03-03 0:00 ` Scott Ingram
2000-03-04 0:00 ` Simon Wright
2000-03-03 0:00 ` Larry Kilgallen
2000-03-04 0:00 ` Robert Dewar
2000-03-04 0:00 ` Ehud Lamm
2000-03-06 0:00 ` Charles Hixson
2000-03-06 0:00 ` Robert Dewar
2000-03-03 0:00 ` Charles H. Sampson
2000-03-04 0:00 ` Jean-Pierre Rosen
2000-03-06 0:00 ` Ted Dennison
2000-03-06 0:00 ` Charles H. Sampson
2000-03-07 0:00 ` Stuart Palin
2000-03-08 0:00 ` Robert Dewar
2000-03-09 0:00 ` Stuart Palin
2000-03-06 0:00 ` Ted Dennison
2000-03-06 0:00 ` Robert A Duff
2000-03-06 0:00 ` tmoran
2000-03-06 0:00 ` Robert Dewar
2000-03-07 0:00 ` Ted Dennison
2000-03-07 0:00 ` Marin D. Condic
2000-03-07 0:00 ` Marin D. Condic
2000-03-06 0:00 ` Robert Dewar
2000-03-07 0:00 ` Ted Dennison
2000-03-08 0:00 ` Robert Dewar
2000-03-11 0:00 ` Robert A Duff
2000-02-29 0:00 ` Ted Dennison
2000-03-01 0:00 ` Robert Dewar
2000-03-01 0:00 ` Ted Dennison
2000-03-01 0:00 ` Robert Dewar
2000-03-01 0:00 ` Ted Dennison
2000-03-01 0:00 ` Wes Groleau
2000-03-02 0:00 ` Robert Dewar
2000-02-29 0:00 ` xl
2000-02-29 0:00 ` Jeffrey Carter
2000-02-29 0:00 ` xl
2000-03-01 0:00 ` Roger Hoyle
2000-02-29 0:00 ` Robert A Duff [this message]
2000-02-29 0:00 ` Ted Dennison
2000-03-01 0:00 ` Robert Dewar
2000-02-29 0:00 ` David Starner
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox