comp.lang.ada
 help / color / mirror / Atom feed
* Assertions in Ada
@ 1997-08-21  0:00 AdaWorks
  1997-08-21  0:00 ` Tucker Taft
  0 siblings, 1 reply; 14+ messages in thread
From: AdaWorks @ 1997-08-21  0:00 UTC (permalink / raw)



Subject: Assertions in Ada
Newsgroups: comp.lang.ada
Organization: Netcom On-Line Services
Summary: 
Keywords: 

Subject: Assertions in Ada
Newsgroups: comp.lang.ada
Organization: Netcom On-Line Services
Summary: 
Keywords: 

I have found the thread on Eiffel versus Ada quite interesting. For a
long time I have believed that Ada should include some form of assertion
mechanism.  I favor the Eiffel words: require, ensure, and invariant.

These could be pragmas in the general form,

    pragma Require(Entity, Data-type, Boolean-Expression)

which would add no new syntax to the language.  Or they could be in
the form of a child package to Ada.Exceptions, also adding no new
syntax to the language.  

In other words, Ada may not need to be redesigned to introduce assertions.
Existing language features might work just fine.  Much of the argument
in favor of Eiffel would simply vanish with the addition of a reliable
assertion mechanism in Ada.

Richard Riehle

-- 

richard@adaworks.com
AdaWorks Software Engineering
Suite 30
2555 Park Boulevard
Palo Alto, CA 94306
(415) 328-1815
FAX  328-1112




^ permalink raw reply	[flat|nested] 14+ messages in thread
* Assertions in Ada
@ 1997-08-22  0:00 AdaWorks
  0 siblings, 0 replies; 14+ messages in thread
From: AdaWorks @ 1997-08-22  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2309 bytes --]



Thanks for the responses to my posting on this subject.  My proposal was intended as the start of a 
dialogue on this subject, not as fodder for comparing the virtues of one progamming language against 
those of another.  I certainly am not calling for immediate action but for recognition that pre-, post, and 
invariant assertions may have a place in designing with Ada.  Except for the gratuitous put-downs,  
�especially to those who do not have experience in language design,�  and �Eiffel envy� the comments 
have been interesting and well-considered.  That said, there is little benefit in any of us comparing Eiffel 
to Ada in this dialogue.

My original note on this subject concerned how the pre-condition, post-condition and invariant 
would benefit Ada.  I probably should have avoided all mention of Eiffel since such mention inevitably
foments language comparisons.  I did say that I like the words �require,�  �ensure,�  and �invariant.�
as they are used in Eiffel.  But that does not imply we should make Ada more like Eiffel.  Instead, it 
means there might be some benefit in further examination of this feature to enhance Ada�s existing 
support for �programming by contract.�

I understand that there would need to be some discussion in the Ada community before we could
come to an agreement on what each assertion means.  The addition of pragma Assert to GNAT is
a good start in the right direction.  

Perhaps this would be a good topic for some kind of Working Group.  

I hesitate to make explicit proposals for the behavior of the pre-, post-, and invariant pragmas in this
posting.  I do have some ideas, of course.  In fact, in a one-on-one discussion with Robert Dewar at 
Ada Europe, he agreed that some of the ideas has merit.  Mostly, I am interested in whether, without
comparing Ada to other languages, Ada could benefit from this feature.  I believe it could.  

I already know there are those with reasons why it cannot work.  Now I would like to see the comments 
from those with reasons why it could.

Richard Riehle
AdaWorks
Suite 30
2555 Park Blvd
Palo Alto, CA  94306
(415) 328-1815
richard@adaworks.com
-- 

richard@adaworks.com
AdaWorks Software Engineering
Suite 30
2555 Park Boulevard
Palo Alto, CA 94306
(415) 328-1815
FAX  328-1112




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~1997-08-31  0:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-21  0:00 Assertions in Ada AdaWorks
1997-08-21  0:00 ` Tucker Taft
1997-08-21  0:00   ` Brian Rogoff
1997-08-22  0:00     ` Robert Dewar
     [not found]   ` <JSA.97Aug21183650@alexandria.organon.com>
1997-08-21  0:00     ` Robert Dewar
1997-08-22  0:00       ` Tucker Taft
1997-08-23  0:00         ` Ken Garlington
1997-08-24  0:00           ` Brian Rogoff
     [not found]         ` <199708251351.PAA13197@basement.replay.com>
1997-08-25  0:00           ` Robert Dewar
1997-08-27  0:00             ` Adrian P. Morgan
1997-08-31  0:00               ` Robert A Duff
1997-08-23  0:00   ` Ken Garlington
1997-08-24  0:00     ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-08-22  0:00 AdaWorks

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