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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,78447032bdbeb343 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn11feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Proposal: pragma Assumption Reply-To: anon@anon.org (anon) References: <30917be5-1446-417c-8a4e-18b2f9a1f420@b1g2000hsg.googlegroups.com> <97479cac-db1a-4654-949b-2caa45031cf1@t54g2000hsg.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Wed, 28 May 2008 01:12:12 GMT NNTP-Posting-Host: 12.64.186.90 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1211937132 12.64.186.90 (Wed, 28 May 2008 01:12:12 GMT) NNTP-Posting-Date: Wed, 28 May 2008 01:12:12 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:410 Date: 2008-05-28T01:12:12+00:00 List-Id: I used Portability for one of many things that proves Ada is a better language. And conditional compiling help to destoys that. Does Ada need "pragma Assumption". No! For GNAT Ada: You can use the "pragma unimplemented_unit;" or adding a routine to a package like the routine used in GNAT Ada System.Interrupts Dummy package ("s-interr-dummy.adb") ------------------- -- Unimplemented; -- ------------------- procedure Unimplemented is begin Ada.Exceptions.Raise_Exception (Program_Error'Identity, "interrupts/signals not implemented"); raise Program_Error; end Unimplemented; Then call "Unimplemented;" where needed. and remove the call when routine is corrected. Or a simple way is to use specification and body packages. Compiling works but binding and linking will cause and error. That can be fixed by creating the routines that are used in the program. Once routine works rename package or move routine to another file. An example -- -- Specification Package: TODO -- package ToDo is -- -- List of functions and procedures specification that need to -- be written. -- end ToDo ; -- -- Procedure Test -- Main program procedure -- with ToDo ; use ToDo ; procedure Test is begin -- -- Use routines that are in "ToDo" package where and when needed. -- end Test ; These examples shows simple reason why this concept was not inserted in 2005 specification. Check the list of rejected Ada 2005 updates. In <97479cac-db1a-4654-949b-2caa45031cf1@t54g2000hsg.googlegroups.com>, =?ISO-8859-1?Q?Santiago_Urue=F1a?= writes: >> I did! You stated in that post: >> >> 'SYMPLIFYING_ASSUMPTION' is a macro very similar to the C 'assert', ... >> >What I mean is that in C/C++ it is implemented using a macro, but of >course this would not be the case for Ada (even a C pragma has nothing >to do with the preprocessor). > >> In conpilers a "MACRO" is consider to be a "conditional compiling" >> statement! >> >Although macros and conditional compilation are done by the >preprocessor, they are very different (and orthogonal) concepts. > >You can compare pragma Assumption with pragma Assert, which is >standard in Ada 2005. Do you think pragma Assert reduces Ada >portability? > >-- >Santiago Urue=F1a-Pascual >Technical University of Madrid (UPM)