comp.lang.ada
 help / color / mirror / Atom feed
* Re[2]: Abstract Functions
@ 2001-07-11 14:49 ANH_VO
  2001-07-11 19:01 ` tmoran
  0 siblings, 1 reply; 3+ messages in thread
From: ANH_VO @ 2001-07-11 14:49 UTC (permalink / raw)
  To: comp.lang.ada

Absolutely, an abstract tagged type can contain data fields. Of course, object
or variable can not be declared.

A. Vo

<< A question I could get answered by the compiler, but maybe this is less
typing: Can I have an abstract tagged type that has data fields? My
recollection of examples I've seen have not had data - just null records. >>





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

* Re: Abstract Functions
  2001-07-11 14:49 Re[2]: Abstract Functions ANH_VO
@ 2001-07-11 19:01 ` tmoran
  2001-07-12 14:10   ` Marin David Condic
  0 siblings, 1 reply; 3+ messages in thread
From: tmoran @ 2001-07-11 19:01 UTC (permalink / raw)


I think a fair summary is "go ahead, write what you want, it's OK".
  In Claw.Sockets, type Socket_Type is non-abstract, with Open,
Read, Close, etc primitives appropriate for a blocking socket.
There's also
type Async_Socket_Type is abstract new Socket_Type with record ...
and various new primitives both abstract, eg,
  procedure When_Readable(Socket : in out Async_Socket_Type) is abstract;
and non-abstract
  procedure When_Connect(Socket : in out Async_Socket_Type);
The user is thus forced to supply a routine to handle incoming data
(When_Readable) but it's optional whether he supplies a non-default
routine to handle the initial connection event.



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

* Re: Abstract Functions
  2001-07-11 19:01 ` tmoran
@ 2001-07-12 14:10   ` Marin David Condic
  0 siblings, 0 replies; 3+ messages in thread
From: Marin David Condic @ 2001-07-12 14:10 UTC (permalink / raw)


Kool!!! I had not thought to take a non-abstract tagged record and turn it
into an abstract tagged record. That would about solve the problem by
specifying an intermediate class that the user derives from - preserving all
the workings of the root class while allowing you to specify new abstract
operations.

Thanks. I'll give that a try and see if the compiler swollows it.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


<tmoran@acm.org> wrote in message
news:qo137.175321$%i7.114223450@news1.rdc1.sfba.home.com...
> I think a fair summary is "go ahead, write what you want, it's OK".
>   In Claw.Sockets, type Socket_Type is non-abstract, with Open,
> Read, Close, etc primitives appropriate for a blocking socket.
> There's also
> type Async_Socket_Type is abstract new Socket_Type with record ...
> and various new primitives both abstract, eg,
>   procedure When_Readable(Socket : in out Async_Socket_Type) is abstract;
> and non-abstract
>   procedure When_Connect(Socket : in out Async_Socket_Type);
> The user is thus forced to supply a routine to handle incoming data
> (When_Readable) but it's optional whether he supplies a non-default
> routine to handle the initial connection event.





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

end of thread, other threads:[~2001-07-12 14:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-11 14:49 Re[2]: Abstract Functions ANH_VO
2001-07-11 19:01 ` tmoran
2001-07-12 14:10   ` Marin David Condic

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