I made some mistakes in my previous comments.  Here are the relevant
items:

Tony Olekshy wrote:
> 
> Glenn Linderman wrote (in RFC 119 v2):
> >
> > RFC 88 uses  the finally keyword as a subclause  introducer for
> > the try statement.  RFC  119 uses the  except and always keywords
> > as subclause introducers for  any statement.
> 
> RFC 88 uses finally *and* catch (just like always and except).

Here's where I started getting off track.  88's catch is not
the same as 119's except, it's the same as 119's catch.  88's
finally is like 119's finally not like 119's always.

> > RFC 119's except clause is  executed only if an exception occurs,
> > which exits the scope containing the statement in which it is
> > defined.
> 
> Same as 88's catch clause.

Sorry, I was wrong there.  119's except is that on-scope-exit thingy.

> > RFC 88's finally clause is executed  if an exception occurs, or if
> > flow of control  falls out  of the bottom  of the  try statement.
> 
> Same as 119's always clause, I believe.

I was wrong again.  The finally clauses are the same in both.

> > RFC 119's always clause is executed  if an exception occurs,
> > or if flow of control exits the scope in any other manner.

Right, now I see your point.  You want always to work, even on
return or goto, in case finally can't (ignoring the syntax for
now).  In this case I think you're stuck.  If finally can't
do it for the reasons I mentioned in my previous message, then
always can't; if one can, so can the other.

> > RFC  88 has  nothing  that  directly corresponds  to  RFC 119's
> > except clause, although that logic could be  included at the end
> > of each catch clause.
> 
> No, you've completely mis-read RFC 88 here.  Its "catch" clause
> directly corresponds to 119's except clause, although I believe
> catch is a bit more general purpose as proposed.

No, I completely mis-read RFC 119.  I'm slowly starting to see that
in RFC 119 catch and finally are like in 88, but except and always
are there for this "other" lexically scoped form of catch and
finally.

> I completely agree with what 119's "always" does, and how nice and
> concise the syntax is.  I just think that should be a separate RFC,
> that "always" should be invoked whenever the lexical variable it is
> associated with goes out of scope (whether or not by unwind), and
> that really, exception handling doesn't enter into it.  It's just
> a lexical destructor block.

I still think that.

> In order to convince me of this, you'll have to present a clear
> set of examples of how RFC 119 handles the kinds of things shown
> in the EXAMPLES section of RFC 88 (and, without all that C stuff).

I still think that.  Please.  As you can see, it's been hard for me
to fish your proposal out of all that C stuff ;-)

> It probably would be a good idea if you clean up some of these
> misconceptions in your next release of 119, just so people don't
> get the wrong idea about 88 ;-)  Thanks.

I still think that's true.  As far as I can tell now, RFC 88 and
119 are very similar in catch/finally functionality, they differ
in syntax and their concept of what an exception object is,
RFC 119 adds that except/always stuff, and RFC 88 says a little
more about some software engineering and implementation details ;-)

If I'm getting close, then the comparison in 119 doesn't make the
simple matters of the previous paragraph apparent, at least not to
me.

Again, sorry about publishing that last message before I read 119
again a couple more times.

Yours, &c, Tony Olekshy

Reply via email to