lua-users home
lua-l archive

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



On Jul 7, 2015, at 7:19 AM, Jay Carlson <nop@nop.com> wrote:

This conversation might have been shorter if somebody said:

"Tuples are a composite sequenced data type with value semantics."

Note that "value semantics" implies that the contents must also have value semantics. This limits them to numbers, strings, booleans, tuples, and possibly light userdata and nil.

Jay


Indeed, though i would prefer “immutable” to “value semantics”. Also, I don’t think light userdata qualifies (the identity doesnt change but the content could, though there is no direct way to know this from Lua). I’m on the fence with nil.

It’s all academic anyway, I very much doubt that tuples will be added to Lua, and as my little “tuple table” scheme shows, it’s pretty easy to add the necessary functionality via a library (though i confess this would be nice as a standard feature, and would even make parts of PiL easier).

—TIm