comp.lang.ada
 help / color / mirror / Atom feed
* Re: Building blocks (Was: Design By Contract)
@ 1997-09-09  0:00 Marc Wachowitz
  1997-09-15  0:00 ` Joachim Durchholz
  1997-09-17  0:00 ` Paul Johnson
  0 siblings, 2 replies; 74+ messages in thread
From: Marc Wachowitz @ 1997-09-09  0:00 UTC (permalink / raw)



paul.johnson@gecm.com (Paul Johnson) wrote:
> In fact the Eiffel exception mechanism is superior to the Ada one
> because it is built on a theoretical model of software engineering.

It is only "superior" if you think that Bertrand Meyer's proposed theory
about exceptions is the only valid one. I don't think it is - and just to
the contrary, I consider something like Eiffel's class EXCEPTION an ugly
hack to differentiate between kinds of exceptions.

In fact, I think Common Lisp, and later C++ and Java, got it right with
using subtyping as a means to differentiate between exception objects and
to associate information with exceptions; likewise, as in Modula-3 and
Java (similarly C++, as far as I know), I'd like to have a classification
of the possible exceptions raised by a routine in its declaration. Lacking
that, Ada's solution is still far superiour to Eiffel's approach, in my
view.

-- Marc Wachowitz <mw@ipx2.rz.uni-mannheim.de>




^ permalink raw reply	[flat|nested] 74+ messages in thread
* Re: Building blocks (Was: Design By Contract)
@ 1997-09-11  0:00 Robert Dewar
  0 siblings, 0 replies; 74+ messages in thread
From: Robert Dewar @ 1997-09-11  0:00 UTC (permalink / raw)



Brian Rogoff complained, quite rightly, to me as quoted below. Sorry for
the mistake in attributions, it is often easy to get confused, and especially
to borrow confusion. Too bad this is not all automated :-)

--
Brian's msg:

Please be careful with attributions, I never wrote that, that was Paul
Johnson! I wrote a rebuttal that Matthew Heaney carelessly edited in his
own follow-up.

-- Brian

On 10 Sep 1997, Robert Dewar wrote:

> Brian Rogoff said
>
> <<>>In fact the Eiffel exception mechanism is superior to the Ada one
> >> because it is built on a theoretical model of software engineering.>>
>
> This is one of the more absurd statements in what is unfortunately becoming
> a rather tedious thread. First of all, the idea that being "built on
> *a* (i.e. any old) theoretical model of software engineering" is per se
> a good thing is a bit laughable.
>
> Second, of course the Ada exception mechanism is build on such a model
> also -- indeed it *is* a model itself!
>
> Rather thank make vague religeous statements like this which have
> zero meaning, say EXACTLY what technical point you are trying to make.









^ permalink raw reply	[flat|nested] 74+ messages in thread
* Re: Building blocks (Was: Design By Contract)
@ 1997-09-09  0:00 Marc Wachowitz
  0 siblings, 0 replies; 74+ messages in thread
From: Marc Wachowitz @ 1997-09-09  0:00 UTC (permalink / raw)



mheaney@ni.net (Matthew Heaney) wrote:
> I've always been curious about the semantics of exception propagation,
> because it doesn't correspond to anything in pure math (or does it?).  If I
> divide x by 0 on paper, I can strug my shoulders and say, "Oh well,
> division by 0 isn't defined," but on a computer, I have to do _something_. 

That's easy. All functions (or generally procedures, or any statements and
expressions) can be seen as mappings from one state to another, and among
the possible outcomes of a such functions are the "normal outcome", where no
exception was raised, and some "abnormal outcome" (possibly indicating the
detailed cause for the exception as well, whether just with a name, or with
additional data, like the error code of some system call). In the area of
applicative languages, and the associated theory, there's even something
known as continuation-passing style, where any sequence of computation is
made explicit by passing to every function another function, the so-called
continuation, which is invoked with the result of the former function. Then
control structure manifests as a choice between many possible continuations.
You could model the dynamic nesting of exception handlers by passing to each
function (in the general sense; i.e. also expressions/statements) both a
continuation for normal cases and a continuation for exceptional cases, and
functions without any own exception handlers would pass along whatever they
received as their exception-continuation. When an exception handler doesn't
propagate the exception, that means that it invokes the appropriate normal
continuation of its own context.

In Scheme (a Lisp dialect), continuations are even available to programmers
and can be used to model a variety of other control structures, including
exceptions, but also backtracking or coroutines. (For detailed background,
I suggest you ask on comp.lang.scheme about these things; there are people
who can probably give you better references to books or papers on the net
than the little I'd have available.)

-- Marc Wachowitz <mw@ipx2.rz.uni-mannheim.de>




^ permalink raw reply	[flat|nested] 74+ messages in thread
* Re: Design By Contract
@ 1997-09-02  0:00 Jon S Anthony
       [not found] ` <JSA.97Sep3201329@alexandria.organon.com>
  0 siblings, 1 reply; 74+ messages in thread
From: Jon S Anthony @ 1997-09-02  0:00 UTC (permalink / raw)



In article <EFuuJK.GKu@syd.csa.com.au> nospam@thanks.com.au (Don Harrison) writes:

> So, if a supplier really needs to restrict what clients can see, for
> whatever reason, they're able to.

Agreed.  Never claimed otherwise.


> However, the good thing about Eiffel is that it gives designers the
> flexibility of exposing as much or as little of an object's
> structure, in contrast with with Ada's you-see-it-all or
> you-see-nothing export policy.

First, whether or not this is "good" depends on many things.

Second, you can play the same game in Ada anyway:

package P is

    type T is limited private;

    type S1 is tagged record
        ...
    end record;

    type S2 is ... end record;

    type Whatever is private;

    function Op1 (X : T) return S1; -- Expose S1 substructure

    function Op2 (X : T) return S2; -- Expose S2 substructure

    function Op3 (X : T) return Whatever; -- Don't expose this bit

...
private
...
end P;


Also, even here, you it is possible to get at the remaining hidden
structure if it is in the private portion with child packages.  So,
per usual, at the end of the day there really isn't enough overall
differences on which to waste energy...

/Jon
-- 
Jon Anthony
OMI, Belmont, MA 02178, 617.484.3383 
"Nightmares - Ha!  The way my life's been going lately,
 Who'd notice?"  -- Londo Mollari




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

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

Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-09  0:00 Building blocks (Was: Design By Contract) Marc Wachowitz
1997-09-15  0:00 ` Joachim Durchholz
1997-09-17  0:00 ` Paul Johnson
1997-09-18  0:00   ` Robert Dewar
1997-09-18  0:00   ` Stephen Leake
1997-09-18  0:00     ` Mark L. Fussell
1997-09-19  0:00       ` Jon S Anthony
1997-09-23  0:00         ` Mark L. Fussell
     [not found]       ` <11861963wnr@eiffel.demon.co.uk>
1997-09-19  0:00         ` Mark L. Fussell
1997-09-19  0:00       ` Robert A Duff
1997-09-20  0:00         ` Joachim Durchholz
1997-09-22  0:00           ` Matthew Heaney
1997-09-23  0:00             ` Veli-Pekka Nousiainen
1997-10-03  0:00               ` Robert I. Eachus
1997-10-04  0:00                 ` Paul Johnson
1997-10-14  0:00                   ` Robert I. Eachus
1997-09-23  0:00             ` Joachim Durchholz
1997-09-23  0:00           ` Jon S Anthony
1997-09-24  0:00           ` Richard A. O'Keefe
1997-09-24  0:00           ` Alan E & Carmel J Brain
1997-09-25  0:00             ` Anonymous
1997-09-30  0:00               ` Alan E & Carmel J Brain
1997-09-30  0:00                 ` Matthew Heaney
1997-09-30  0:00                   ` W. Wesley Groleau x4923
1997-09-30  0:00                     ` Matthew Heaney
1997-10-01  0:00                     ` Alan E & Carmel J Brain
1997-09-30  0:00                   ` Neil Wilson
1997-09-30  0:00                     ` Stephen Leake
1997-10-01  0:00                 ` Anonymous
1997-10-01  0:00                   ` Joachim Durchholz
1997-10-01  0:00                   ` Paul M Gover
1997-10-04  0:00                     ` Paul Johnson
1997-10-04  0:00                       ` Matthew Heaney
1997-10-15  0:00                         ` Paul Johnson
1997-10-15  0:00                           ` Matthew Heaney
1997-10-16  0:00                             ` Joachim Durchholz
1997-10-17  0:00                               ` Robert I. Eachus
1997-10-16  0:00                           ` Joachim Durchholz
1997-10-22  0:00                           ` Reimer Behrends
1997-10-02  0:00                   ` Robert A Duff
1997-10-02  0:00                     ` Tucker Taft
1997-10-02  0:00                       ` Matthew Heaney
1997-10-03  0:00                     ` Stephen Leake
1997-10-04  0:00                     ` Matthew Heaney
1997-10-07  0:00                       ` Robert A Duff
1997-09-18  0:00     ` W. Wesley Groleau x4923
1997-09-21  0:00       ` Matthew Heaney
1997-09-18  0:00   ` Jon S Anthony
  -- strict thread matches above, loose matches on Subject: below --
1997-09-11  0:00 Robert Dewar
1997-09-09  0:00 Marc Wachowitz
1997-09-02  0:00 Design By Contract Jon S Anthony
     [not found] ` <JSA.97Sep3201329@alexandria.organon.com>
1997-09-04  0:00   ` Paul Johnson
     [not found]     ` <5un58u$9ih$1@gonzo.sun3.iaf.nl>
1997-09-06  0:00       ` Building blocks (Was: Design By Contract) Joachim Durchholz
1997-09-08  0:00       ` Paul Johnson
1997-09-08  0:00         ` Brian Rogoff
1997-09-09  0:00           ` Veli-Pekka Nousiainen
1997-09-09  0:00             ` Jon S Anthony
1997-09-09  0:00           ` Veli-Pekka Nousiainen
1997-09-09  0:00           ` Matthew Heaney
1997-09-09  0:00             ` W. Wesley Groleau x4923
1997-09-10  0:00               ` Robert A Duff
1997-09-12  0:00                 ` Jon S Anthony
1997-09-09  0:00             ` Brian Rogoff
1997-09-10  0:00             ` Paul Johnson
1997-09-10  0:00               ` Darren New
1997-09-10  0:00               ` Matthew Heaney
1997-09-10  0:00             ` Robert Dewar
1997-09-12  0:00               ` Paul Johnson
1997-09-14  0:00                 ` Robert Dewar
1997-09-14  0:00                 ` Robert Dewar
1997-09-14  0:00                 ` Robert Dewar
1997-09-15  0:00                   ` John G. Volan
1997-09-12  0:00               ` Jon S Anthony
1997-09-12  0:00                 ` Robert Dewar
1997-09-16  0:00                   ` Brian Rogoff
1997-09-09  0:00           ` W. Wesley Groleau x4923

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