[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Method Tables - a modified Lua 4.1 Work Beta implementation
- From: "Joshua Jensen" <jjensen@...>
- Date: Wed, 28 Nov 2001 20:00:12 -0700
After the discussion with Edgar, I have made a couple changes (see
below). The amount of modified Lua code is now even less.
After the discussion about unified methods, I have copied just the
method table code from the LuaState distribution and put it in a clean
Lua 4.1 Work Beta implementation.
Credit for the method tables implementation goes to Edgar Toernig, who
created the method tables for Sol. Except for the parser changes and
new VM opcodes, this is 100% Edgar's work.
Documentation can be found in the "Unified Methods" and "Standard
Unified Method Callbacks" sections of
http://www.workspacewhiz.com/Other/LuaState/LuaState.html with the
* The LuaState :: operator is now gone.
* Due to parser changes in Lua 4.1 Work Beta (as opposed to Lua 4.1
Alpha), it is no longer possible to:
The modified directories can be found here. Just do a diff of the
original Lua 4.1 Work Beta code and this code to see the small number of
* Added luaL_openlibintotable() helper function (Sol).
* Added LUA_NTYPES #define. (Sol)
* Added lua_getmethods(). (Sol)
* Added lua_getdefaultmethods(). (Sol)
* Added lua_setmethods(). (Sol)
* Implements lua_getmethods(). (Sol)
* Implements lua_getdefaultmethods(). (Sol)
* Implements lua_setmethods(). (Sol)
* Added function luaK_selfmethod().
* Added functions travtable() and travmethods(). (Sol)
* In function getname(), a travmethods() call has been added. (Sol)
* Function marktable() has been upgraded to check the methods table.
* markobject() has been upgraded to wander user data's methods. (Sol)
* checkMbuffer() has been fixed to compile under VC6.
* Added function luaB_methods(). (Sol)
* Default method tables are created. (Sol)
* File method table created. (Sol)
* Number method table created. (Sol)
* String method table created. (Sol)
* In luaX_lex(), the case for a - (minus) has been upgraded to check for
(greater than) symbol following.
* The struct Udata has a Table* methods member added. (Sol)
* The struct Table has a Table* methods member added. (Sol)
* Upgraded to handle the new opcode OP_SELFMETHOD.
* In primaryexp(), the case TK_POINTSAT has been added.
* In function f_luaopen(), method tables are built into the global
* struct global_State has Table* methods[LUA_NTYPES] array added. (Sol)
* luaS_newudata() assigns the default userdata method table. (Sol)
* luaH_new() assigns the default table method table. (Sol)
* In function newkey(), settableval() was fixed to compile under VC6.
* Functions luaT_getmethods() and luaT_setmethods() added. (Sol)
* Function luaV_getmethod() added.
* Virtual machine opcode OP_SELFMETHOD implemented.