From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: GNAT and user-defined aspects and pragmas? Date: Thu, 12 Nov 2015 15:42:12 -0600 Organization: JSA Research & Innovation Message-ID: References: <87h9ku2dcp.fsf@adaheads.sparre-andersen.dk> <87d1vg3mvm.fsf@adaheads.sparre-andersen.dk> <46a5f0e0-50a5-4f11-b8cf-57f7f320fcd7@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1447364533 19379 24.196.82.226 (12 Nov 2015 21:42:13 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 12 Nov 2015 21:42:13 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:28345 Date: 2015-11-12T15:42:12-06:00 List-Id: "Shark8" 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.