comp.lang.ada
 help / color / mirror / Atom feed
* pragma Convention() Ada2012
@ 2012-07-21 19:16 wlan.etho0
  2012-07-21 20:09 ` Niklas Holsti
  0 siblings, 1 reply; 8+ messages in thread
From: wlan.etho0 @ 2012-07-21 19:16 UTC (permalink / raw)


According to the New aspects section of: http://en.wikibooks.org/wiki/Ada_Programming/Ada_2012#New_aspects

"Convention (pragma now obsolescent)"

I've tried researching it, but you know how hard it is to find good information about obscure language features in ada.

I don't fully understand what this means, can someone explain it to me?



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

* Re: pragma Convention() Ada2012
  2012-07-21 19:16 pragma Convention() Ada2012 wlan.etho0
@ 2012-07-21 20:09 ` Niklas Holsti
  2012-07-21 20:27   ` Dmitry A. Kazakov
  2012-07-21 20:29   ` wlan.etho0
  0 siblings, 2 replies; 8+ messages in thread
From: Niklas Holsti @ 2012-07-21 20:09 UTC (permalink / raw)


On 12-07-21 22:16 , wlan.etho0@gmail.com wrote:
> According to the New aspects section of:
> http://en.wikibooks.org/wiki/Ada_Programming/Ada_2012#New_aspects
>
> "Convention (pragma now obsolescent)"
>
> I've tried researching it, but you know how hard it is to find good
> information about obscure language features in ada.

Actually I don't... what information have you tried to find?

> I don't fully understand what this means, can someone explain it to
> me?

There is a "pragma Convention" that has been in Ada for some time, I 
think since Ada 95, 
http://www.adaic.org/resources/add_content/standards/95lrm/ARM_HTML/RM-B-1.html#I6047.

The "aspect" system was added in Ada 2012, including the Convention 
aspect, http://www.ada-auth.org/standards/12rm/html/RM-B-1.html#I7339.

The Convention aspect has the same effect as the Convention pragma, but 
it has the advantage that the entity to which the aspect applies is 
given by the position of the aspect specification, not by an identifier. 
This is better since it is easier both to write and to read and because 
it avoids the problem of overloaded names. Therefore the pragma is 
considered obsolescent, which simply means that you can still use it, 
but that the language designers think that there are better ways (the 
aspect) to do it.

Does this answer you question, or is it that you don't understand what 
the Convention aspect (or pragma) does?

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .





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

* Re: pragma Convention() Ada2012
  2012-07-21 20:09 ` Niklas Holsti
@ 2012-07-21 20:27   ` Dmitry A. Kazakov
  2012-07-21 21:00     ` Florian Weimer
  2012-07-21 20:29   ` wlan.etho0
  1 sibling, 1 reply; 8+ messages in thread
From: Dmitry A. Kazakov @ 2012-07-21 20:27 UTC (permalink / raw)


On Sat, 21 Jul 2012 23:09:10 +0300, Niklas Holsti wrote:

> The Convention aspect has the same effect as the Convention pragma, but 
> it has the advantage that the entity to which the aspect applies is 
> given by the position of the aspect specification, not by an identifier.

On the other hand a pragma can be placed in the private part of the
package, which looks more appropriate for an implementation-specific thing.

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



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

* Re: pragma Convention() Ada2012
  2012-07-21 20:09 ` Niklas Holsti
  2012-07-21 20:27   ` Dmitry A. Kazakov
@ 2012-07-21 20:29   ` wlan.etho0
  1 sibling, 0 replies; 8+ messages in thread
From: wlan.etho0 @ 2012-07-21 20:29 UTC (permalink / raw)


Thank you,

This does answer my question.



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

* Re: pragma Convention() Ada2012
  2012-07-21 20:27   ` Dmitry A. Kazakov
@ 2012-07-21 21:00     ` Florian Weimer
  2012-07-22  5:17       ` Shark8
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2012-07-21 21:00 UTC (permalink / raw)


* Dmitry A. Kazakov:

> On Sat, 21 Jul 2012 23:09:10 +0300, Niklas Holsti wrote:
>
>> The Convention aspect has the same effect as the Convention pragma, but 
>> it has the advantage that the entity to which the aspect applies is 
>> given by the position of the aspect specification, not by an identifier.
>
> On the other hand a pragma can be placed in the private part of the
> package, which looks more appropriate for an implementation-specific thing.

I don't think this is possible in general because the entity has
usually been frozen at that point.



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

* Re: pragma Convention() Ada2012
  2012-07-21 21:00     ` Florian Weimer
@ 2012-07-22  5:17       ` Shark8
  2012-07-23  0:56         ` Adam Beneschan
  0 siblings, 1 reply; 8+ messages in thread
From: Shark8 @ 2012-07-22  5:17 UTC (permalink / raw)


On Saturday, July 21, 2012 3:00:40 PM UTC-6, Florian Weimer wrote:
> 
> I don't think this is possible in general because the entity has
> usually been frozen at that point.

I think you're right; the Specification file *must* be able to provide the correct information on generating subprogram-calls, which is impacted by conventions, but I know you can put the convention-pragmas in the private section.



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

* Re: pragma Convention() Ada2012
  2012-07-22  5:17       ` Shark8
@ 2012-07-23  0:56         ` Adam Beneschan
  2012-07-23 20:37           ` Florian Weimer
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Beneschan @ 2012-07-23  0:56 UTC (permalink / raw)


On Saturday, July 21, 2012 10:17:24 PM UTC-7, Shark8 wrote:
> On Saturday, July 21, 2012 3:00:40 PM UTC-6, Florian Weimer wrote:
> > 
> > I don't think this is possible in general because the entity has
> > usually been frozen at that point.
> 
> I think you're right; the Specification file *must* be able to provide the
> correct information on generating subprogram-calls, which is impacted by
> conventions, but I know you can put the convention-pragmas in the private
> section.

Yes, usually.  I think Florian is confused.  I'm not sure what he was thinking about, but the "private" keyword that separates the private part of a specification from the visible part doesn't freeze anything, as far as I know.  When the *end* of the specification is reached, then many things that weren't frozen before become frozen, but the private part comes before that.  So most Convention pragmas in the private part are OK.

                              -- Adam



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

* Re: pragma Convention() Ada2012
  2012-07-23  0:56         ` Adam Beneschan
@ 2012-07-23 20:37           ` Florian Weimer
  0 siblings, 0 replies; 8+ messages in thread
From: Florian Weimer @ 2012-07-23 20:37 UTC (permalink / raw)


* Adam Beneschan:

> On Saturday, July 21, 2012 10:17:24 PM UTC-7, Shark8 wrote:
>> On Saturday, July 21, 2012 3:00:40 PM UTC-6, Florian Weimer wrote:
>> > 
>> > I don't think this is possible in general because the entity has
>> > usually been frozen at that point.
>> 
>> I think you're right; the Specification file *must* be able to provide the
>> correct information on generating subprogram-calls, which is impacted by
>> conventions, but I know you can put the convention-pragmas in the private
>> section.
>
> Yes, usually.  I think Florian is confused.

Yes, I am.  Thanks for setting me straight.



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

end of thread, other threads:[~2012-07-26 15:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21 19:16 pragma Convention() Ada2012 wlan.etho0
2012-07-21 20:09 ` Niklas Holsti
2012-07-21 20:27   ` Dmitry A. Kazakov
2012-07-21 21:00     ` Florian Weimer
2012-07-22  5:17       ` Shark8
2012-07-23  0:56         ` Adam Beneschan
2012-07-23 20:37           ` Florian Weimer
2012-07-21 20:29   ` wlan.etho0

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