comp.lang.ada
 help / color / mirror / Atom feed
From: "Stephen Cole" <s_k_cole@userat.freeserve.co.uk>
Subject: Re: Simple Question 3
Date: Sun, 14 Oct 2001 23:08:51 +0100
Date: 2001-10-14T22:08:09+00:00	[thread overview]
Message-ID: <9qd2c9$4a2$1@news7.svr.pol.co.uk> (raw)
In-Reply-To: 3BC9FD23.ACEB872A@acm.org


"Jeffrey Carter" <jrcarter@acm.org> wrote in message
news:3BC9FD23.ACEB872A@acm.org...
>
> We could perhaps be of more assistance if you could define what you
> expect the compiler to do for
>
> X : Mytesttype2 := Unitc;
>
> What is the value of X after initialization? Specifically, what is the
> value of X.C?
>
> --
> Jeff Carter
> "I fart in your general direction."
> Monty Python & the Holy Grail

I would have thought that the compiler would have looked for a function
called UnitC() that would return a type MyTesttype2. If it could not find
one then it would flag a static match failure and so the whole problem of
X.C being initialised would not have occured as it would not be allowed.

HOWEVER

if it had been...

X: MyTestType1'class := UnitC

I would have expected it to have accepted it as there is only one UnitC()
function in existence (in my Ada world). If there were two then it would be
refused as ambiguouse. But this not the case as Ada will not accept the
derivation of a new type without also requiring that all base type functions
that return a base type value, be redeclared in terms of the new type. Which
may be proper but I don't see why?!

Sorry. Maybe I'm just being thick. I'll try an read the ARM95 manual. There
must be a good reason as I have not come across anything yet in Ada which
does not have a good reason.










  reply	other threads:[~2001-10-14 22:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-11 14:28 Simple Question 3 Stephen Cole
2001-10-11 22:41 ` tmoran
2001-10-12 11:33   ` Stephen Cole
2001-10-12 17:03     ` tmoran
2001-10-14  7:51     ` Jean-Marc Bourguet
2001-10-12 13:33 ` David C. Hoos
2001-10-14 18:53 ` Stephen Cole
2001-10-14 20:45   ` Vincent Marciante
2001-10-14 21:00   ` Jeffrey Carter
2001-10-14 22:08     ` Stephen Cole [this message]
2001-10-15  6:26       ` Jeffrey Carter
2001-10-14 21:15   ` Primitive operations and derived types (Was: Simple Question 3) Jacob Sparre Andersen
2001-10-14 21:42   ` Simple Question 3 tmoran
2001-10-14 22:30     ` Stephen Cole
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox