comp.lang.ada
 help / color / mirror / Atom feed
* new types
@ 2001-05-08  2:39 Bob McChesney
  2001-05-08  3:41 ` Larry Hazel
  0 siblings, 1 reply; 4+ messages in thread
From: Bob McChesney @ 2001-05-08  2:39 UTC (permalink / raw)


Could anyone please help me? I'm trying to make a new type of an access
type. Is that possible?

eg.
you know you can do:
    type BobType is new Integer

but can you do:
    type BobType is new Set_Class.Set
where Set is:
    type Set access Set_Header
?????

I've tried to do this and I get the error 'invalid prefix in selected
component "Set_Class" '

I don't know if it matters but Set_Class is generic.

Thanks,
Bob McChesney





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: new types
  2001-05-08  2:39 new types Bob McChesney
@ 2001-05-08  3:41 ` Larry Hazel
  2001-05-08 13:36   ` Ted Dennison
  2001-05-08 15:29   ` Bob McChesney
  0 siblings, 2 replies; 4+ messages in thread
From: Larry Hazel @ 2001-05-08  3:41 UTC (permalink / raw)


Bob McChesney wrote:
> 
> Could anyone please help me? I'm trying to make a new type of an access
> type. Is that possible?
> 
> eg.
> you know you can do:
>     type BobType is new Integer
> 
> but can you do:
>     type BobType is new Set_Class.Set
> where Set is:
>     type Set access Set_Header
> ?????
> 
> I've tried to do this and I get the error 'invalid prefix in selected
> component "Set_Class" '
> 
> I don't know if it matters but Set_Class is generic.
> 
> Thanks,
> Bob McChesney

Set_Class.Set doesn't exist if Set_Class is generic.  A new type Set is created
for each instantiation of Set_Class.

Larry



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: new types
  2001-05-08  3:41 ` Larry Hazel
@ 2001-05-08 13:36   ` Ted Dennison
  2001-05-08 15:29   ` Bob McChesney
  1 sibling, 0 replies; 4+ messages in thread
From: Ted Dennison @ 2001-05-08 13:36 UTC (permalink / raw)


In article <3AF76ADC.1E8E5771@mindspring.com>, Larry Hazel says...
>
>Bob McChesney wrote:
>> 
>> but can you do:
>>     type BobType is new Set_Class.Set
>> where Set is:
>>     type Set access Set_Header
>> ?????
>> 
>> I've tried to do this and I get the error 'invalid prefix in selected
>> component "Set_Class" '
>> 
>> I don't know if it matters but Set_Class is generic.
>Set_Class.Set doesn't exist if Set_Class is generic.  A new type Set is created
>for each instantiation of Set_Class.

Right. In other words, you'll have to instantiate the generic first:

package My_Set is new Set_Class;

Then use the *instantiation* name in your type.

type Bobtype is new My_Set.Set;

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: new types
  2001-05-08  3:41 ` Larry Hazel
  2001-05-08 13:36   ` Ted Dennison
@ 2001-05-08 15:29   ` Bob McChesney
  1 sibling, 0 replies; 4+ messages in thread
From: Bob McChesney @ 2001-05-08 15:29 UTC (permalink / raw)


Thanks very much,

I haven't used generic sets before now, and didn't know what I was doing. I
think I understand now though.

Thanks,

Bob McChesney






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-05-08 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-08  2:39 new types Bob McChesney
2001-05-08  3:41 ` Larry Hazel
2001-05-08 13:36   ` Ted Dennison
2001-05-08 15:29   ` Bob McChesney

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