lua 链表 迭代器
2015-12-09 16:43
369 查看
local function getnext (list, node) if not node then return list else return node.next end end function traverse(list) return getnext, list, nil end list = nil for line in io.lines() do if line == "" then break end list = {val = line, next = list} end for node in traverse(list) do print(node.val) end
相关文章推荐
- Luajit反编译之探索记
- lua 5.2 GC 源码分析 一
- 使用luabind生成dll文件
- iOS使用lua语言的使用步骤与实现插件的动态更新
- Assembly x64 Intro - Horner Polynomial Evaluation
- lua之读写plist文件
- lua 5.2 GC 源码分析 二
- VS2012编译luabind
- Lua源码分析——C文件说明
- Introduction to Recommender System 之 Module 5 Evaluation
- Lua与VC的交互
- 关于c调用lua 对‘luaL_newstate()’未定义的引用的问题解决办法
- 【Codeforces Round 276 (Div 2)B】【水题】Valuable Resources 最小正方形包含所有点
- Lua 初识之 loadfile、require、module - 十五
- lua交互API函数入门系列-堆栈[1]
- lua字符串的分割函数
- Lua 初识之面向对象 - 十四
- Lua转让C功能
- VS下LUA编程环境搭建
- Lua Mac&Windows开发环境组建及部分语法例子