finally keyword changed since 1.5 ?

Dar Scott dsc at swcp.com
Thu May 13 13:10:15 EDT 2004


On Thursday, May 13, 2004, at 08:03 AM, Jan Decroos wrote:

>> I think we have a difference of opinion on what should happen here.  I
>> think the 'finally' should be executed.  I understand your position to
>> be that it should not be.
>>
>
>
> No no : I think it should *always* execute the finally section just 
> the way is was in Rev 1.5 and as the documentation tells (finally).

Whoops.  I meant Klaus' position.

We might be seeing an irresistible force encountering an immovable 
object.  The 'finally' says that execution cannot leave the try without 
executing the finally.  The 'exit to top' says exit immediately.  In my 
opinion, the 'finally' is stronger.

It is more important that this is consistent.  We have similar systems 
and yet we see different behavior.

If Klaus' interpretation does become the correct one, we can do this:

try
    ...
    throw "exit to top"
    ...
catch e
    if e is "exit to top" then throw e
    ...
finally
    ...
end try

This assumes the error-in-catch bug is resolved.

That is, I think these should be equivalent:

try
   a
catch e
   b
finally
   c
end try

-- vs

try
   try
     a
   catch e
     b
   end try
catch e
finally
  c
end try

Dar



More information about the Use-livecode mailing list