comp.lang.ada
 help / color / mirror / Atom feed
Subject: Re: Generic formal access types
Date: Thu, 01 May 2003 15:00:49 +0200
Date: 2003-05-01T15:00:49+02:00	[thread overview]
Message-ID: <3eb11a85@epflnews.epfl.ch> (raw)
In-Reply-To: 1459423.SpdnhGgvRt@linux1.krischik.com

Martin Krischik wrote:
> Rodrigo Garcï¿œa <rodrigo.garcia.ARROBA.epfl.ch> wrote:
> 
> should
> 
> generic
>      type Access_Type is private;
>     Null_Value : Access_Type := nul;
> 
> not work as well?

   No, it does not work. The compiler does not know until you 
instantiate the package wether Access_Type is really an access type, so 
it will not accept "null" as initial value for Null_Value. That is, in 
fact, the problem and the reason why I would want to express somehow 
that "Access_Type" must be instantiated by an actual access type without 
necessarily specifying the accessed object type.

   I do not know if I made myself clear, but you can always try to 
compile your solution in order to convince you...

Rodrigo

> 
> Regards
> 
> Martin
> 
> 
>>That seems a nice workaround, although I still have to pass two
>>parameters during instantiation. I will give it a try!
>>
>>Thanks,
>>
>>Rodrigo
>>
>>Chad R. Meiners wrote:
>>
>>How about
>>
>>generic
>>    type Access_Type is private;
>>    Null_Value : Access_Type;
>>
>>-CRM
> 
> 





  reply	other threads:[~2003-05-01 13:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-30 18:30 Generic formal access types 
2003-04-30 19:27 ` Simon Wright
2003-05-01  8:58   ` 
2003-04-30 21:42 ` Chad R. Meiners
2003-05-01  9:06   ` 
2003-05-01  9:58     ` Martin Krischik
2003-05-01 13:00       `  [this message]
2003-05-02  9:14         ` Ludovic Brenta
2003-05-02 10:43           ` 
2003-05-02 10:50             ` 
2003-05-01 10:09     ` 
2003-05-02  1:14 ` tmoran
2003-05-02  9:52   ` 
2003-05-02 16:18     ` tmoran
2003-05-02 16:57       ` Robert A Duff
2003-05-02 19:39         ` Randy Brukardt
2003-05-05  8:14         ` 
2003-05-05 16:40         ` Matthew Heaney
2003-05-05 17:34           ` Robert A Duff
replies disabled

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