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,ae776ae9b3416efc,start X-Google-Attributes: gid103376,public From: Lane Wimberley Subject: Package name qualifier on function? Date: 1998/02/06 Message-ID: <34DB9059.7E4E@mcc.com>#1/1 X-Deja-AN: 322783990 Content-Transfer-Encoding: 7bit Sender: news@mcc.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Microelectronics and Computer Technology Corp. Newsgroups: comp.lang.ada Date: 1998-02-06T00:00:00+00:00 List-Id: I am new to the world of Ada programming. I have come across the following and my Rational VADS compiler has no trouble with it. -- code somebody else wrote... -- Foo spec: package Foo is type internalfoothing is private; function create return internalfoothing; private type somethingelse; type somethingelseptr is access somethingelse; type internalfoothing is new somethingelseptr; end Foo; -- spec of different package that withs Foo package: with Foo; package Bar is type FooThing is private; private type FooThing is new Foo.internalfoothing; end Bar; -- body of different package package body Bar is function create(param : someparamtype) returns FooThing is newfoothing : FooThing; begin newfoothing := create; -- why is this OK? return newfoothing; end create; end Bar; As the comment indicates, I can't figure out why the compiler accepts the invocation of "create" without any package qualifier. I would have expected to see "Foo.create" Also, why do I get no complaint about the fact that "create" returns an InternalFooThing yet newfoothing is of type FooThing? Any help MUCH appreciated! -- Lane Wimberley Microelectronics and Computer Technology Corporation Austin, TX