comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Re: On packages hierarchy
Date: Mon, 28 Jul 2014 19:35:12 +0300
Date: 2014-07-28T19:35:12+03:00	[thread overview]
Message-ID: <lr5u3t$9ka$1@speranza.aioe.org> (raw)
In-Reply-To: 4vuBv.121143$pu5.79212@fx27.iad

Shark8 wrote:

> On 28-Jul-14 07:41, Victor Porton wrote:
>> I am going to create the package RDF.Raptor.Iostream which would be Ada
>> bindings around
>> http://librdf.org/raptor/api/raptor2-section-iostream.html
>>
>> Afterward, I am going to create Ada IO stream (derived from
>> Root_Stream_Type) which encaspulates (wraps) RDF.Raptor.Iostream and
>> reversely RDF.Raptor.Iostream which encaspulates (wraps)
>> Root_Stream_Type.
>>
>> Should packages which wrap each other be in child packages of
>> RDF.Raptor.Iostream? I think no, because they do not require access to
>> internals (private part) of RDF.Raptor.Iostream but child packages have
>> access to private parts.
>>
>> So, should they be siblings, like RDF.Raptor.Iostream_To_Ada and
>> RDF.Raptor.Iostream_From_Ada? (Also please help to conceive good names
>> for these packages.)
>>
> 
> Er, why?
> 
>> Streams are a method to read or write any object to any medium,
>> and thus they are doubly generalized. This also means that you
>> are bounded by the most restrictive set of operations common to
>> all mediums. As an example, you cannot provide position control
>> in a general manner because not all transmission modes are
>> random-access (like receiving a radio-signal), and not all
>>  streams are bi-directional (like a light-sensor).
> 
> Why not just have a single stream type?

I want to make an interface to streams of Raptor C library.

Because, as you say, we are to have a single stream type, this type should 
be well-interfaces with that "single" Ada stream class.

> Moreover, Ada's root-stream is abstract, so you can't have objects of
> that type.

Well, I mean object of Root_Stream_Type'Class.

-- 
Victor Porton - http://portonvictor.org


  reply	other threads:[~2014-07-28 16:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 13:41 On packages hierarchy Victor Porton
2014-07-28 16:03 ` Shark8
2014-07-28 16:35   ` Victor Porton [this message]
2014-07-28 23:24     ` Shark8
2014-07-29 12:36       ` Victor Porton
2014-07-29 18:44         ` Shark8
2014-07-29 19:42           ` Simon Wright
2014-07-29 21:26             ` Shark8
replies disabled

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