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:10:44 -0700 (PDT)
Date: 2008-05-26T10:10:44-07:00	[thread overview]
Message-ID: <379b6b72-261a-4f5b-a84e-04e58cfe55f9@26g2000hsk.googlegroups.com> (raw)
In-Reply-To: 4839e959$0$6551$9b4e6d93@newsspool3.arcor-online.net

> This sounds much like pragma Debug together with the language
> defined restriction  No_Implementation_Pragmas  to me.
>
 pragma Debug ([CONDITION, ]PROCEDURE_CALL_WITHOUT_SEMICOLON);

Although in theory it is possible to achieve the same effects of
pragma Assumption using pragma Debug, it would be very awkward: it
doesn't receive a boolean condition but a subprogram call (the first
parameter is just to enable/disable it at run-time), so a new
procedure should be created to evaluate the desired condition, and
then raise an exception explicitly when false. This pragma is more
focused for execution logs.

Furthermore, pragma Debug is very similar to pragma Assert in the
sense that it can be left on production code during the whole life of
the application. So even if a programmer is willing to add so much
code for each assumption, she won't be able to use pragma Debug for
any other uses (probably she shouldn't use any other implementation
defined pragma at all).

Best regards,



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