[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: mass alias assignment?
- From: Dirk Laurie <dpl@...>
- Date: Fri, 11 Feb 2011 11:22:02 +0200
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