lua-users home
lua-l archive

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


On Fri, Feb 11, 2011 at 05:56:33AM +0200, Xavier Wang wrote:
> 
> What will happen if we add a = b = c support in lua?

1. Lua will look more like C.

2. The Lua syntax definition will have been bloated, and someone will 
have needed to spend a lot time on implementation, merely so that
we can type 

    a = b = c = d = e = math.pi

instead of 

    a,b,c,d,e = rep(math.pi,5)

where 'rep' is defined earlier as 

-- Lua 5.1 code
function rep(a,n) local t={} for i=1,n do t[i]=a end return unpack(t) end

Dirk