[code snippet] print_lua_object

Update print_lua_object.lua so that it can be required
[code snippet] use macro in lua

use macro to define the get/set methords in lua