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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6cb2525ffbfe23ce X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Why both "with" and "use"? Date: 1999/02/14 Message-ID: #1/1 X-Deja-AN: 444139876 Sender: matt@mheaney.ni.net References: <36C5B28C.F32C43A4@jps.net> <36c60d14.12851112@news.pacbell.net> NNTP-Posting-Date: Sat, 13 Feb 1999 17:52:11 PDT Newsgroups: comp.lang.ada Date: 1999-02-14T00:00:00+00:00 List-Id: tmoran@bix.com (Tom Moran) writes: > alternatively, you could do > package Digitizers is > type ID is range 1 .. 2; > ... > end Digitizers; > with Digitizers; > ... > Digitizer : Digitizers.ID; > which would leave out the Use clause, let the compiler help make sure > the naming is right, and let the maintainer or simple minded source > code tool easily spot the origin of Digitizers.ID. This won't work, because you need the types to be separate from the Digitizers package. The organization looks something like this: with Digitizer_Id_Types; use Digitizer_Id_Types; package Digitizers is procedure Set_Mode (Id : in Digitizer_Id); ... end Digitizers; There are clients of Digitizer_Id who are not clients of Digitizers, and they have to be protected from the volatility of the Digitizers package, or you end up recompiling the universe every day.