You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Syntax support for Lua 5.4 attributes. And you can still use both the `const` and `close` declaration and get constant check and scoped callback working when targeting Lua versions below 5.4.
4
+
5
+
```yuescript
6
+
const a = 123
7
+
close _ = <close>: -> print "Out of scope."
8
+
```
9
+
<YueDisplay>
10
+
11
+
```yue
12
+
const a = 123
13
+
close _ = <close>: -> print "Out of scope."
14
+
```
15
+
16
+
</YueDisplay>
17
+
18
+
You can do desctructuring with variables attributed as constant.
19
+
20
+
```yuescript
21
+
const {:a, :b, c, d} = tb
22
+
-- a = 1
23
+
```
24
+
<YueDisplay>
25
+
26
+
```yue
27
+
const {:a, :b, c, d} = tb
28
+
-- a = 1
29
+
```
30
+
31
+
</YueDisplay>
32
+
33
+
You can also declare a global variable to be `const`.
0 commit comments