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,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dc92e67e9f6fd6eb X-Google-Attributes: gid103376,public From: johnherro@aol.com (John Herro) Subject: Re: Scope of variables in package ?? Date: 1996/06/28 Message-ID: <4qvu8s$imj@newsbf02.news.aol.com>#1/1 X-Deja-AN: 162519535 sender: root@newsbf02.news.aol.com references: <31D1A979.103B@vzcorp.com> organization: America Online, Inc. (1-800-827-6364) newsgroups: comp.lang.ada Date: 1996-06-28T00:00:00+00:00 List-Id: "Sandeep V. Kharkar" writes: > If a function/procedure is defined as SEPARATE,i.e., > implementation outside the PACKAGE BODY, can it still see > variables defined inside the PACKAGE BODY but > not in the PACKAGE SPECIFICATION ?? If I understand your question correctly, it can see variables defined in the package body (above the function/procedure) AND variables defined in the package specification. For example, package P is I : Integer; procedure Test; end P; package body P is F : Float; procedure Test is separate; end P; separate (P) procedure Test is ... -- Test can see both I and F. end Test; There's much, much more to the subject. For example programs outside package P that "with" the package can see I but not F. This feature of Ada, called information hiding, can help contain the effects of certain changes to your program, so that they don't impact other parts of the program. Private package parts, which I haven't discussed here, improve information hiding even further. For more information, download my Ada Tutor program, available at the Web and FTP sites below my signature. I hope this helps. - John Herro Software Innovations Technology http://members.aol.com/AdaTutor ftp://members.aol.com/AdaTutor