lua-users home
lua-l archive

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


Thank you very much。

Roberto Ierusalimschy <roberto@inf.puc-rio.br> 于2021年6月10日周四 下午9:04写道:
> Hello everyone
>       I am reading a function check_conflic, but I can't think of the
> actual Lua code corresponding to it. Can anyone give me an example? thank
> you all. by the way, i'm reading lua5.1.5

local a, b = {}, 10
a[b], b = 20, 30
print(a[10], a[30])

The correct answer is 20, nil. If you remove check_conflict, this
example will print nil, 20.

-- Roberto