From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,c999596f866f316a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-10 06:25:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.usenet-edu.net!usenet-edu.net!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: with and use Date: Wed, 10 Jul 2002 15:25:00 +0200 Organization: Adalog Message-ID: References: <3D2C2FF9.4020300@yahoo.com> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1026307442 25419 195.25.228.57 (10 Jul 2002 13:24:02 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Wed, 10 Jul 2002 13:24:02 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Xref: archiver1.google.com comp.lang.ada:26983 Date: 2002-07-10T15:25:00+02:00 List-Id: "David Rasmussen" 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