comp.lang.ada
 help / color / mirror / Atom feed
* why access parameter in stream attributes to begin with, instead of in or in/out ?
@ 2018-06-11 21:49 Mehdi Saada
  2018-06-11 22:48 ` Shark8
  2018-06-12  6:28 ` Mehdi Saada
  0 siblings, 2 replies; 5+ messages in thread
From: Mehdi Saada @ 2018-06-11 21:49 UTC (permalink / raw)


Hi.

I wondered why in Ichibiah's design, in the beginning, stream have been made to work with access types/access parameters ?  I could have imagined that the attributes would work with a in/out stream parameter, and stream(blabla) would give an object of stream type.
I don't know if storing streams' access values for later use is common, one would just have to add .all when appropriate...

Thanks.


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

* Re: why access parameter in stream attributes to begin with, instead of in or in/out ?
  2018-06-11 21:49 why access parameter in stream attributes to begin with, instead of in or in/out ? Mehdi Saada
@ 2018-06-11 22:48 ` Shark8
  2018-06-11 23:17   ` Randy Brukardt
  2018-06-12  6:28 ` Mehdi Saada
  1 sibling, 1 reply; 5+ messages in thread
From: Shark8 @ 2018-06-11 22:48 UTC (permalink / raw)


On Monday, June 11, 2018 at 3:49:28 PM UTC-6, Mehdi Saada wrote:
> Hi.
> 
> I wondered why in Ichibiah's design, in the beginning, stream have been made to work with access types/access parameters ?
Hard to say; his design [Ada83] didn't have streams.

> I could have imagined that the attributes would work with a in/out stream parameter, and stream(blabla) would give an object of stream type.
> I don't know if storing streams' access values for later use is common, one would just have to add .all when appropriate...
Good questions, I want to say it's not common to pop access-type via streams, but maybe I'm just unadventurous.

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

* Re: why access parameter in stream attributes to begin with, instead of in or in/out ?
  2018-06-11 22:48 ` Shark8
@ 2018-06-11 23:17   ` Randy Brukardt
  0 siblings, 0 replies; 5+ messages in thread
From: Randy Brukardt @ 2018-06-11 23:17 UTC (permalink / raw)


"Shark8" <onewingedshark@gmail.com> wrote in message 
news:cb1b3f8b-bf3b-4768-99af-5575a55cf682@googlegroups.com...
> On Monday, June 11, 2018 at 3:49:28 PM UTC-6, Mehdi Saada wrote:
>> Hi.
>>
>> I wondered why in Ichibiah's design, in the beginning, stream have been 
>> made to work with access types/access parameters ?
> Hard to say; his design [Ada83] didn't have streams.

Right, streams were an Ada 95 feature.

>> I could have imagined that the attributes would work with a in/out stream 
>> parameter, and stream(blabla) would give an object of stream type.
>> I don't know if storing streams' access values for later use is common, 
>> one would just have to add .all when appropriate...
> Good questions, I want to say it's not common to pop access-type via 
> streams, but maybe I'm just unadventurous.

Ada 83/95/2005 do not allow functions to have parameters that are out or in 
out. "access" was (mistakenly) thought to be a work-around for that. 
Streams, being an Ada 95 feature, used that work-around. It used it 
consistently, I suppose so that all of the stream attributes would work the 
same (it would be weird for Input and Read to work differently - remember, 
Input is a function and has to be one since the result in unconstrained).

                                          Randy.



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

* Re: why access parameter in stream attributes to begin with, instead of in or in/out ?
  2018-06-11 21:49 why access parameter in stream attributes to begin with, instead of in or in/out ? Mehdi Saada
  2018-06-11 22:48 ` Shark8
@ 2018-06-12  6:28 ` Mehdi Saada
  2018-06-12  8:30   ` Dmitry A. Kazakov
  1 sibling, 1 reply; 5+ messages in thread
From: Mehdi Saada @ 2018-06-12  6:28 UTC (permalink / raw)


Oh... Understood. In the first draft/drafts, functions were in/out, that was forsaken for the sake of purity from side-effects, then for the sake of the said side-effects access parameters are added (don't know if dispatching on access parameters/results were added at the same moment), yet they waited one more version to put back in-out function parameters... Surely there are many reasons (probably) but it still seems funny.


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

* Re: why access parameter in stream attributes to begin with, instead of in or in/out ?
  2018-06-12  6:28 ` Mehdi Saada
@ 2018-06-12  8:30   ` Dmitry A. Kazakov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry A. Kazakov @ 2018-06-12  8:30 UTC (permalink / raw)


On 2018-06-12 08:28, Mehdi Saada wrote:
> Oh... Understood. In the first draft/drafts, functions were in/out, that was forsaken for the sake of purity from side-effects, then for the sake of the said side-effects access parameters are added (don't know if dispatching on access parameters/results were added at the same moment), yet they waited one more version to put back in-out function parameters... Surely there are many reasons (probably) but it still seems funny.

There was no clear understanding of the contracts back then. Absence of 
side effects is a behavioral contract #1. It is different from absence 
of effects on the parameters #2. One can have any combination of these 
two. The choice was to have functions with any side effects allowed but 
no effects on the parameters except the dedicated one = the result. It 
was a pragmatic choice because that time it was impossible to have 
contracts on the side effects. Now we have SPARK and profiles, it should 
be possible.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


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

end of thread, other threads:[~2018-06-12  8:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11 21:49 why access parameter in stream attributes to begin with, instead of in or in/out ? Mehdi Saada
2018-06-11 22:48 ` Shark8
2018-06-11 23:17   ` Randy Brukardt
2018-06-12  6:28 ` Mehdi Saada
2018-06-12  8:30   ` Dmitry A. Kazakov

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