[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 3rd UPDATE: try-catch-finally for Lua, 02/1/2008
- From: Mark Hamburg <mhamburg@...>
- Date: Thu, 31 Jan 2008 22:00:25 -0800
on 1/31/08 7:43 PM, Hu Qiwei at huqiwei@gmail.com wrote:
> 3) Scoping change: local variables defined in try-block will live till
> the end of finally- or catch- block. by popular demand.
Isn't that tricky to make work with variables that may not even be declared
at the point where one exits the try block?
try
if true then
return
end
local x = { }
finally
x[ 1 ] = "foo"
end
"x" isn't even defined at the point where we exit the try block. (I had an
even more twisted version where I used the ability to redeclare local
variables and started the try block with "local x = 3".
Mark