summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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
数字表示方式