From 5cb9a124093805edc520d6db59e606c7668b68d5 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Fri, 12 May 2023 11:49:11 +0800 Subject: update docs. --- doc/docs/doc/README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/docs/doc/README.md b/doc/docs/doc/README.md index 7f5aab1..3c910fd 100755 --- a/doc/docs/doc/README.md +++ b/doc/docs/doc/README.md @@ -1,8 +1,10 @@ --- sidebar: auto +title: Reference --- # Yuescript + logo ## Introduction @@ -1264,7 +1266,7 @@ catch err ## Attributes -Syntax support for Lua 5.4 attributes. But you can use still use `const` declaration and get constant check functioning when targeting Lua versions below 5.4. +Syntax support for Lua 5.4 attributes. But you can use still use `const` declaration and get constant check working when targeting Lua versions below 5.4. ```moonscript const a = 123 @@ -1277,6 +1279,19 @@ close _ = <close>: -> print "Out of scope." +You can do desctructuring with variables attributed as constant. + +```moonscript +const {:a, :b, c, d} = tb +-- a = 1 +``` + +
+const {:a, :b, c, d} = tb
+-- a = 1
+
+
+ ## Literals All of the primitive literals in Lua can be used. This applies to numbers, strings, booleans, and **nil**. -- cgit v1.2.3-55-g6feb