Re: Try Finally...
From: Martin Harvey (Demon account) (martin_at_nospam_pergolesi.demon.co.uk)
Date: 10/25/04
- Next message: Martin Harvey (Demon account): "Re: Try Finally..."
- Previous message: Martin Harvey (Demon account): "Re: Try Finally..."
- In reply to: Maarten Wiltink: "Re: Try Finally..."
- Next in thread: L D Blake: "Re: Try Finally..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 25 Oct 2004 18:20:32 GMT
On Mon, 25 Oct 2004 13:41:12 +0200, "Maarten Wiltink"
<maarten@kittensandcats.net> wrote:
>How is this non-continuable? The CD can be put back and the read operation
>restarted.
Apart from a bug in some older versions of windows to do with demand
paging of code from removable media....
>
>[...]
>
>> Try/Except/Finally is not Structured Exception Handling. It is a
>> language specific (c++) *interface* to windows standard SEH. It wasn't
>> all that long ago David and I spent a couple of weeks getting this all
>> sorted out.
>
>C++? Where did that come from?
That's erroneous, but the sentiment is correct. the Delphi exception
handling constructs are a wrapper around the win32 structured
exception handling mechanism which allows you to daisychain handlers,
and involves some interesting algorithms.
>> Now WINDOWS takes over and begins unwinding the exception list.
>
>This is an implementation detail. I couldn't care less _who_ unwinds
>the stack, as long as the exception gets handled by the book.
>A programming language is a virtual machine.
Windows unwinds the exception list, but ISTR that on the second
traversal, some app specific code has to help unwind the stack.
>>> That's the whole idea of a finally block. It's not supposed to handle
>>> exceptions.
>>
>> Yet, oddly enough it's invoked by them all the time.
Poor terminology ... we should distinguish between execution on
exception, and exception "handing" in the sense of "removal".
>> The problem is that **when invoked by an exception** the current Delphi
>> implementation of "Finally" *always* terminates the program... there is
>> no carrying on.
No it doesn't terminate the program ... it simply doesn't handle (i.e.
remove) the exception. However, other handlers further down the chain
can catch the exception, and execution of the program then can
continue from within the context of those handlers. You seem to be
forgetting the chained / nested properties of these handlers.
MH.
- Next message: Martin Harvey (Demon account): "Re: Try Finally..."
- Previous message: Martin Harvey (Demon account): "Re: Try Finally..."
- In reply to: Maarten Wiltink: "Re: Try Finally..."
- Next in thread: L D Blake: "Re: Try Finally..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|