LUA constant
来源:互联网 发布:德军总部新巨人 知乎 编辑:程序博客网 时间:2024/06/05 18:54
function constant(who)local smt = function(who)local mtt = {__index = function(t,k)return who[k]end,__newindex = function(t,k,v)if(who[k] == nil) then who[k] = v;endend}return mtt;endlocal tag = {}setmetatable(tag, smt(who))return tagendfunction main()local PROTOCOLS = constant({TCP=1,UDP=2,ICMP=3,RAW=4})PROTOCOLS.IDP = 9;print(PROTOCOLS.TCP);PROTOCOLS.TCP = 5;print(PROTOCOLS.TCP)print(PROTOCOLS.IDP)endxpcall(main, function(msg)end)
0 0
- LUA constant
- Constant
- constant
- struts constant
- struts2 - constant
- struts constant
- struts2 constant
- constant常量
- struts <constant/>
- android Constant
- Constant Pool
- CONSTANT MEMORY
- Constant pointer & Pointer constant
- LUA
- Lua
- LUA
- lua
- Lua
- java 文件操作
- NavBarControl 左侧菜单
- auto_ptr的实现与剖析
- 一个比较复杂的多次拆分字符串的存储过程
- matlab中fspecial中生成高斯模板的解释以及c语言实现
- LUA constant
- 查看 并发请求数及其TCP连接状态
- 用C#实现网络爬虫(一)
- AspectJ AOP 简单示例2
- 【ViewPager的学习】一、简单使用
- 网络编程
- 服务器TIME_WAIT和CLOSE_WAIT详解和解决办法
- 自定义ViewGroup
- 项目在eclipse运行正常,但单独部署到tomcat上出现乱码解决办法