comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: GNAT and user-defined aspects and pragmas?
Date: Thu, 12 Nov 2015 15:42:12 -0600
Date: 2015-11-12T15:42:12-06:00	[thread overview]
Message-ID: <n2313l$itj$1@loke.gir.dk> (raw)
In-Reply-To: 46a5f0e0-50a5-4f11-b8cf-57f7f320fcd7@googlegroups.com


"Shark8" <onewingedshark@gmail.com> wrote in message 
news:46a5f0e0-50a5-4f11-b8cf-57f7f320fcd7@googlegroups.com...
On Thursday, November 12, 2015 at 12:24:28 PM UTC-7, Randy Brukardt wrote:
>
>> Certain ARG members are highly confused. :-) Nothing that is an aspect 
>> ever
>> should have been a pragma, and aspects should be considered a replacement
>> for pragmas rather than some sort of parallel syntax.
>
>About the only instance where should-have-been-aspects-pragmas make any
>sense is with Import and Export. Things like, say, OpenGL with its 
>half-million
>(slight exaggeration) definitions of Color, would be done cleaner with the 
>single
>Pragma Import than individual aspects.

Using overloading to cut down the number of pragmas one writes is precisely 
the kind of evil that aspects avoid. The problem is that usually you want 
all but one Color to be Imported, that one has it's own body to provide some 
Ada benefit (perhaps raising an exception, or using default parameters). And 
of course you have to search all of the source for a pragma, while an aspect 
is right on the declaration (since it changes the semantics of the 
declaration, it should be included as part of the declaration). [Overloaded 
routines also often need different link names for the different bodies, and 
that can't be done with a pragma, at least without jumping through hoops.]

In any case, Ada is not about decreasing the amount of typing one needs to 
do, it's about clearly expressing your intentions. Separating aspects from 
declarations does not help in such expressions.

                                       Randy.



  reply	other threads:[~2015-11-12 21:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 13:28 GNAT and user-defined aspects and pragmas? Jacob Sparre Andersen
2015-11-10 19:53 ` Dennis Lee Bieber
2015-11-11  9:29   ` Jacob Sparre Andersen
2015-11-12 19:24     ` Randy Brukardt
2015-11-12 20:37       ` Shark8
2015-11-12 21:42         ` Randy Brukardt [this message]
2015-11-13 10:03       ` J-P. Rosen
2015-11-11 11:14   ` Simon Wright
2015-11-12 19:27     ` Randy Brukardt
2015-11-13  8:51       ` J-P. Rosen
replies disabled

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