comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: c2ada bug report filed
Date: Fri, 01 Apr 2011 07:38:23 +0100
Date: 2011-04-01T07:38:23+01:00	[thread overview]
Message-ID: <m2pqp6o4rk.fsf@pushface.org> (raw)
In-Reply-To: in38hh$gc7$1@munin.nbi.dk

"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Simon Wright" <simon@pushface.org> wrote in message 
> news:m24o6jovd3.fsf@pushface.org...
> ...
>> I shall have a think about this, the 'access' approach is certainly
>> neat. There's the question of whether null is allowed; if it is, and
>> customers are using Ada95, 'access' is ruled out.
>
> All anonymous access types in Ada 95 were null excluding; passing "null" to 
> them was not allowed. The ARG recommended that all Ada 95 compilers support 
> "not null" syntactically (it would have no effect at runtime) in order to 
> minimize the incompatibility problems of switching back and forth between 
> Ada 95 and Ada 2005. Don't know if that recommendation was adopted widely (I 
> believe that Janus/Ada does allow it in Ada 95 mode).
>
> Either "in" or "access" in Ada 95 would not allow null, so if that is 
> needed, a named access type has to be used. Ada 2005 would require "not 
> null" if null is to be excluded (as noted, Ada 95 compilers are supposed to 
> support that, but who knows how many do).
>
> I personally don't like seeing access in any interface that can avoid it. 
> But if you need to be able to pass null, you don't have a choice. If not, I 
> think "in" is preferred.

It took me a moment to see your point! which is, I think, that (from ARM
B.3) pragma Convention (C) will pass structs and arrays as pointers
anyway. Hmm.

A binding generator will have trouble distinguishing the parameter mode,
of course.



      reply	other threads:[~2011-04-01  6:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30  8:15 c2ada bug report filed Jerry
2011-03-30 14:15 ` Simon Wright
2011-03-30 20:03   ` Simon Wright
2011-04-02  4:45     ` Jerry
2011-04-04 17:27       ` Simon Wright
2011-04-04 23:46         ` Jerry
2011-03-31 18:01 ` Per Sandberg
2011-03-31 21:03   ` Simon Wright
2011-04-01  1:07     ` Randy Brukardt
2011-04-01  6:38       ` Simon Wright [this message]
replies disabled

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