官术网_书友最值得收藏!

nil

A nil value represents the absence of data. If you try to access a variable that has not been created yet, its value will be nil. If you are done using a variable, you should assign it to be nil. This code first prints nil because nothing is assigned to the variable foo. Then, the string bar is assigned, and after this the code prints bar. Finally, nil is assigned back to the variable. The last time the variable is printed, it will print nil again:

print (foo) -- will print: nil
foo = "bar"
print (foo) -- will print: bar
foo = nil
print (foo) -- will print: nil
主站蜘蛛池模板: 安陆市| 黄大仙区| 黎川县| 大方县| 微博| 安溪县| 六枝特区| 探索| 开平市| 桂东县| 东乌| 普兰店市| 凉城县| 濮阳县| 手游| 读书| 习水县| 全州县| 宝应县| 定安县| 光山县| 岐山县| 黄冈市| 宁海县| 杭州市| 栾城县| 丽江市| 上林县| 宁城县| 合水县| 剑河县| 竹山县| 河东区| 新干县| 德江县| 清水县| 泽普县| 万安县| 宣汉县| 子洲县| 苏尼特左旗|