lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 18/08/15 04:54 PM, Sean Conner wrote:
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?)

Time-sensitive stuff.

--
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.