comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: with and use
Date: Wed, 10 Jul 2002 15:25:00 +0200
Date: 2002-07-10T15:25:00+02:00	[thread overview]
Message-ID: <aghchh$oqb$1@s1.read.news.oleane.net> (raw)
In-Reply-To: 3D2C2FF9.4020300@yahoo.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]


"David Rasmussen" <pinkfloydhomer@yahoo.com> a �crit dans le message news: 3D2C2FF9.4020300@yahoo.com...
> First of all, what does this message from GNAT mean:
>
> "with" can only appear in context clause
>
A context clause is a clause that appears *before* a compilation unit. A with clause cannot appear *inside* anything else, so this
basically means that you have to move the with clause on top of the unit.

> Secondly, where is with and use typically used, and what is the
> difference between them?
>
A with clause means that a compilation unit needs the services from another *compilation unit* (i.e. a package, subprogram or
generic which is separately compiled).

A use clause factors out a *package*, i.e. you don't have to repeat the package name in front of every element.
Since a package can (but needs not) be a compilation unit, there are cases where both clauses can be applied, but they are really
orthogonals.

--
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





  reply	other threads:[~2002-07-10 13:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-10 13:00 with and use David Rasmussen
2002-07-10 13:25 ` Jean-Pierre Rosen [this message]
2002-07-10 13:45   ` David Rasmussen
2002-07-10 14:24     ` Jean-Pierre Rosen
2002-07-10 19:17       ` Ted Dennison
2002-07-10 17:18     ` Jeffrey D. Cherry
  -- strict thread matches above, loose matches on Subject: below --
2002-07-10 17:20 Gautier direct_replies_not_read
replies disabled

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