[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [local] <namelist> = do <block> =<explist> end
- From: Sean Conner <sean@...>
- Date: Tue, 18 Aug 2015 15:54:54 -0400
It was thus said that the Great Soni L. once stated:
> Hello!
>
> I'd like a way to do
>
> local v
> do v = 3 end
>
> without assigning nil to v.
>
> Can we get expressionblocks?
What, exactly, is wrong with
local v
do
v = 3
end -- ?
It works, even with additional local variables:
local a,b,c
do
a = 1
b = 2
c = a * somefunc(b) + someotherthing()
end
I use this pattern quite often in Lua.
-spc (What, exactly, are you doing that require all these proposals you
make?)