comp.lang.ada
 help / color / mirror / Atom feed
From: "Santiago Urueña" <suruena@gmail.com>
Subject: Re: Proposal: pragma Assumption
Date: Mon, 26 May 2008 10:21:44 -0700 (PDT)
Date: 2008-05-26T10:21:44-07:00	[thread overview]
Message-ID: <9620f961-8b81-45b7-8ab1-db6db5e381a5@c65g2000hsa.googlegroups.com> (raw)
In-Reply-To: m2mymdz8ns.fsf@mac.com

> I've been using pragma Fixme; for this -- OK, won't fail in production
> (unless you use GNAT & -gnatwe, treat warnings as errors, or your
> compiler's equivalent).
>
Interesting, that's very close to this type of assertions (except that
it doesn't document much, and it won't fail if any test tries to
exercise the unimplemented code). Which compiler has that pragma?

http://www.adacore.com/wp-content/files/auto_update/gnat-unw-docs/html/gnat_rm_2.html

Currently GNAT has the following related pragmas, but none is close to
pragma Fixme or Assumption:

 pragma Assert (boolean_EXPRESSION [, string_EXPRESSION]);
 pragma Check (
     [Name    =>] Identifier,
     [Check   =>] Boolean_EXPRESSION
  [, [Message =>] string_EXPRESSION] );
 pragma Check_Name (check_name_IDENTIFIER);
 pragma Check_Policy ([Name =>] Identifier, CHECK|IGNORE);

 pragma Compile_Time_Error
         (boolean_EXPRESSION, static_string_EXPRESSION);
 pragma Compile_Time_Warning
         (boolean_EXPRESSION, static_string_EXPRESSION);

 pragma Debug ([CONDITION, ]PROCEDURE_CALL_WITHOUT_SEMICOLON);
 pragma Debug_Policy (CHECK | IGNORE);

 pragma Postcondition (
   [Check   =>] Boolean_Expression
 [,[Message =>] String_Expression]);
 pragma Precondition (
   [Check   =>] Boolean_Expression
 [,[Message =>] String_Expression]);


Pragma Assert, Check (generalization of Assert), Debug, Postcondition
and Postcondition are evaluated at run-time, but are intended for the
whole life of the application. In contrast, pragma Compile_Time_Error
and Compile_Time_Warning are evaluated at compilation time (mainly to
detect assertion errors when instantiating a generic), so cannot be
equivalent to pragma Assumption.


Regards,

--
Santiago Urueña-Pascual
Technical University of Madrid (UPM)



  reply	other threads:[~2008-05-26 17:21 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 [this message]
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
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