工作内容 |
1.复习 10分钟 2.学习Programming in Lua.pdf 函数章节 2.5小时 3.做练习setting 的security 模块 3小时 4.小组讨论 1小时
|
学习心得 |
1. 如果要对多个变量赋值必须依次对每个变量赋值。 1)a, b, c = 0 print(a,b,c) --> 0 nil nil 2)a, b, c = 0, 0, 0 print(a,b,c) --> 0 0 0 2.使用圆括号强制使调用返回一个值。 print((foo0())) --> nil print((foo1())) --> a print((foo2())) --> a 一个return 语句如果使用圆括号将返回值括起来也将导致返回一个值。 2. unpack()函数:以数组作为输入参数,返回数组的所有元素值 a={“hello”,”world”} print(unpack(a)) -->hello world ps;可以用此函数输出表的元素 3. 哑元 dummy variable,用下划线表示 local _,x=string.find(x,y) --只使用第二个返回值 4. 尾调用:当函数最后一个动作是调用另外一个函数时,我们称这种调用尾调用 当被调用函数 结束时程序不需要返回到调用者, 所以尾调用之后程序不需要在栈中保留关于调用者的任何信息。 5. 每次闭包的成功调用后这些外部局部变量(upvalue)都保存他们的值( 状态) 6.使某一个按键与另一个按键处理相同的效果: <!-- On LSK, simulate a CLR key to exit -->
|
6. 遗留问题 |
1.loadPage是否在groupMain内替换页面?不断的laodPage就不断的替换? 2.appFrame页面template/layout/impl中 <include res="contentBackground/impl"/>的用途是? 3. appFrame页面template/layout/impl中 <include res="background/impl" />的用途是?
|