summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-06-08 18:41:30 +0800
committerchai <chaifix@163.com>2018-06-08 18:41:30 +0800
commit6b643026c2a6745b2ec0a62aaaad422c7d7bc2b4 (patch)
treeb7c3f4af1f2fb4b3ac53a6ba7578a4cd19e5933b
parent4e9d6b9a1b416c5ca31b441a2bcf40c214da1658 (diff)
-rw-r--r--test/hello.lls23
1 files changed, 12 insertions, 11 deletions
diff --git a/test/hello.lls b/test/hello.lls
index 1124b43..105aa0a 100644
--- a/test/hello.lls
+++ b/test/hello.lls
@@ -7,16 +7,17 @@ lls本身并不提供除了
的函数,全部需要用户手动绑定。官方提供std包,包含一些常用的功能
数据类型:
- real 实数 值
- boolean 布尔值 值
- ---------------------------
- string 字符串 地址
- set 集合 地址
- array 数组 地址
- ---------------------------
- function 函数 地址(仅)
-
-new关键字会拷贝内存,如果没有new则会使用地址赋值
+ real | 实数 | 值
+ boolean | 布尔值 | 值
+ --------+--------+----------
+ string | 字符串 | 地址
+ set | 集合 | 地址
+ array | 数组 | 地址
+ --------+--------+----------
+ function| 函数 | 地址(仅)
+
+new关键字会拷贝内存,如果没有new则会使用地址赋值。
+引用计数=0时会被标记可回收。在GC时回收内存。
local s = "hello";
local a = s;
@@ -76,7 +77,7 @@ io.print(s);
关键字
null
true false
- local global
+ local global 声明一个变量时必须制定作用域,否则是赋值
new
数字表示方式