For the purposes of this article, the final parameter, userdata, is not necessary.
就本文的目的来说,最后一个参数userdata是不需要的。
There are eight fundamental types (of values) in Lua: nil, Boolean, number, string, function, thread, table, and userdata.
Lua中的基本类型(值)有8种:nil,布尔型,数字,字符串,函数,线程,表以及用户数据。
You can think of userdata as an array of bytes — bytes that might represent a pointer, a structure, or a file in the host application.
我们可以认为userdata就是一个字节数组——字节可以表示指针、结构或宿主应用程序中的文件。
Additional support exists for custom userdata objects, which can be defined by developers to handle types beyond those of the basic system.
另外,Lua还支持定制的userdata对象,开发人员可以通过定义userdata对象来处理基本类型以外的其他类型。
Because tables and userdata are so flexible, Lua permits you to overload operations for objects of either type. (you cannot overload the six other types.)
由于表和用户数据都非常灵活,因此Lua允许我们重载这两种类型的数据的操作(不能重载其他6种类型)。
Userdata allows arbitrary C data to be stored in variables.
用户数据允许在变量中任意存储C数据。
Note that for websphere.ras notifications which contain a MessageEvent as the userData, we invoke the getLocalizedMessage simply to display a readable version of the actual notification data.
请注意,对于包含MessageEvent作为 userData的websphere.ras通知,要显示实际通知数据的可读版本,只需调用 getLocalizedMessage 即可。
Note that for websphere.ras notifications which contain a MessageEvent as the userData, we invoke the getLocalizedMessage simply to display a readable version of the actual notification data.
请注意,对于包含MessageEvent作为 userData的websphere.ras通知,要显示实际通知数据的可读版本,只需调用 getLocalizedMessage 即可。
应用推荐