英文原版:
http://www.lua.org/manual/5.1/
中文版下面2个地址都有:一样的
- manual.luaer.cn lua在线手册
- lua参考手册Lua参考手册的中文翻译(云风翻译版本)
重要部分:
2.2 – Values and Types
Lua is a dynamically typed language. This means that variables do not have types; only values do. There are no type definitions in the language. All values carry their own type.
All values in Lua are first-class values. This means that all values can be stored in variables, passed as arguments to other functions, and returned as results.
Lua 中的所有值都是一值(first-class) 的。 这意味着所有的值都可以被放在变量里,当作参数传递到另一个函数中,并被函数作为结果返回。
There are eight basic types in Lua: nil, boolean, number, string, function, userdata, thread, and table. Nil is the type of the value nil, whose main property is to be different from any other value; it usually represents the absence of a useful value.
Boolean is the type of the values false and true. Both nil and false make a condition false; any other value makes it true. Number represents real (double-precision floating-point) numbers. (It is easy to build Lua interpreters that use other internal representations for numbers, such as single-precision float or long integers; see file luaconf.h
.) String represents arrays of characters. Lua is 8-bit clean: strings can contain any 8-bit character, including embedded zeros ('