comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: Heterogenous_Array_Test: please explain error
Date: Wed, 13 Jun 2001 14:42:54 GMT
Date: 2001-06-13T14:42:54+00:00	[thread overview]
Message-ID: <OZKV6.6778$pb1.258478@www.newsranger.com> (raw)
In-Reply-To: slrn9iedo6.hl.lutz@taranis.iks-jena.de

In article <slrn9iedo6.hl.lutz@taranis.iks-jena.de>, Lutz Donnerhacke says...
>
>* Ted Dennison wrote:
>>"Child_Component". If you want to access that component, you have to tell the
>>compiler that the type is really "Child" (which it will verify at runtime just
>>to be sure). I think something like the following will work, though I haven't
>>compiled it:
>>
>>Child'(Item(2).all).Child_Component := 22;
>
>Does this work on a copy of Child initialized with Item(2).all?
>
>I thought typecasts match the pattern "Typ(Expression)" not
>"Typ'(Expression)", but i may fail.

The form without the tick is a conversion, and constraint checks (along with any
other appropriate checks) will be performed. The form with the tick (a
"qualified expression") is more like a clarification, or a hint to the compiler
which might have otherwise been confused about what type is being used. For that
reason, I'm not sure it will work here. You might need to remove the tick and
try the conversion.

Note that this is a simple explanation, not a fully accurate one. To get that,
you'd need to consult the LRM.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



  reply	other threads:[~2001-06-13 14:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-12 20:32 Heterogenous_Array_Test: please explain error M. A. Alves
2001-06-12 19:44 ` Ehud Lamm
2001-06-12 19:50 ` Ted Dennison
2001-06-13  9:52   ` Lutz Donnerhacke
2001-06-13 14:42     ` Ted Dennison [this message]
2001-06-13 14:48       ` Ehud Lamm
2001-06-13 15:40         ` Ted Dennison
2001-06-13 17:10           ` Ehud Lamm
replies disabled

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