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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.200.46.61 with SMTP id r58mr70961441qta.7.1470510022040; Sat, 06 Aug 2016 12:00:22 -0700 (PDT) X-Received: by 10.157.56.165 with SMTP id p34mr1448514otc.6.1470510021978; Sat, 06 Aug 2016 12:00:21 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!j37no7069552qta.0!news-out.google.com!d68ni18909ith.0!nntp.google.com!f6no7886288ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 6 Aug 2016 12:00:21 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8302:3f70:49c2:3a36:cc37:a052; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8302:3f70:49c2:3a36:cc37:a052 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: child class of limited_controlled not inheriting data From: rieachus@comcast.net Injection-Date: Sat, 06 Aug 2016 19:00:22 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:31306 Date: 2016-08-06T12:00:21-07:00 List-Id: On Friday, August 5, 2016 at 2:59:16 PM UTC-4, b.mcgui...@gmail.com wrote: > I defined a base class as ...=20 > function To_Date (days : Integer; fraction : Real) return Date; > function To_Date (time_string : String) return Date; ...=20 > What is wrong here? Actually you have the solution right there, except that you will want to ov= erride To_Date for your Julian date abstraction to correct the times. Juli= an dates, at least in astronomical use, begin at noon GMT. (I could chide = you for not having a timezone parameter everywhere needed, but I am going t= o assume that you will add that after you get the basics working. ;-) There is a bit of magic necessary in your overriding of To_Date. You need = to call the original function: function To_Date(days : Integer; fraction : Real) return Julian_Date is Jdays: Integer :=3D days; Jfraction: Real :=3D fraction; begin -- fix up Jdays and Jfraction here. return sofa.time.two_part_date.To_Date(Jdays,Jfraction) with null; end To_Date; I would probably use a fixed point type, Milliseconds, instead of your Floa= t fraction, but even if I could convince you why it is better, it probably = is not worth changing, unless you are pointing a really big telescope at as= teroids.