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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,23777acd564d513b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-17 14:17:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.stueberl.de!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Sat, 18 Jan 2003 02:10:30 +0500 References: <3e274cad$0$33929$bed64819@news.gradwell.net> Organization: Extreme Code Software (http://ex-code.com) Subject: Re: Problem Eliminating constructors Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii X-URL: http://www.ex-code.com/ Message-ID: <3e2880f5$0$33930$bed64819@news.gradwell.net> NNTP-Posting-Date: 17 Jan 2003 22:17:25 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1042841845 news.gradwell.net 33930 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:33159 Date: 2003-01-17T22:17:25+00:00 List-Id: In article <3E281F79.A309AD5E@brighton.ac.uk>, John English writes: > Victor Porton wrote: >> >> package A is >> >> type A_Type is tagged >> record >> X: Integer; >> end; >> >> function Create(X: Integer) return A_Type; -- guess what is the body >> >> end A; [skip] >> Compiler requires me to override Create as the return type changes. >> But it is meaningless as now I need Create with two parameters >> instead of one. >> >> What to do? > > Take Create out of package A and make it a child of the package: > > function A.Create(X: Integer) return A.A_Type is ...; > > Now Create will no longer be a primitive operation of A_Type since > it isn't declared in the same package spec, but you can refer to > it in exactly the same way (except you would need "with A.Create" > to be able to call it). Also it does not work if A is a subpackage (as it really is). I would need also to make A a child package instead what would force me to do complete restructurization of the packages tree.