comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Re: Proposal: pragma Assumption
Date: Wed, 28 May 2008 01:12:12 GMT
Date: 2008-05-28T01:12:12+00:00	[thread overview]
Message-ID: <Mj2%j.41725$we7.34776@bgtnsc04-news.ops.worldnet.att.net> (raw)
In-Reply-To: 97479cac-db1a-4654-949b-2caa45031cf1@t54g2000hsg.googlegroups.com

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?= <suruena@gmail.com> 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)




  reply	other threads:[~2008-05-28  1:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-25 18:59 Proposal: pragma Assumption Santiago Urueña
2008-05-25 22:34 ` Georg Bauhaus
2008-05-26 17:10   ` Santiago Urueña
2008-05-26 10:01 ` Simon Wright
2008-05-26 17:21   ` Santiago Urueña
2008-05-26 18:21     ` Simon Wright
2008-05-27  8:11       ` Santiago Urueña
2008-05-27 19:08         ` Simon Wright
2008-05-27  3:28 ` anon
2008-05-27  7:51   ` Santiago Urueña
2008-05-27  9:39     ` anon
2008-05-27 10:39       ` Georg Bauhaus
2008-05-27 11:27       ` Santiago Urueña
2008-05-28  1:12         ` anon [this message]
2008-05-28  7:54           ` Santiago Urueña
2008-05-30  0:27             ` Randy Brukardt
2008-05-30  7:50               ` Georg Bauhaus
2008-05-30 11:03                 ` Santiago Urueña
2008-05-31  5:56                 ` Stephen Leake
2008-05-31  9:04                   ` Georg Bauhaus
2008-06-02  8:24                   ` Santiago Urueña
2008-06-02 19:35                     ` anon
2008-05-30 11:02               ` Santiago Urueña
2008-05-28  7:58 ` Santiago Urueña
2008-05-28  8:24   ` Jean-Pierre Rosen
2008-05-28 13:11     ` Santiago Urueña
2008-05-28  9:14   ` Georg Bauhaus
2008-05-28 13:14     ` Santiago Urueña
2008-05-28 11:01   ` anon
replies disabled

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