We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 383194b commit 09dedc1Copy full SHA for 09dedc1
docs/QoL Improvements/Universal Block Opener.md
@@ -0,0 +1,23 @@
1
+Pluto allows `do` to be used as a universal block opener, meaning it can be used instead of `then` and `begin`.
2
+```pluto title="If Statement Example"
3
+local x = 3
4
+if x == 3 do
5
+ print("x is 3!")
6
+end
7
+```
8
+```pluto title="Class Statement Example"
9
+class Human do
10
+ function __construct(public name) end
11
+ function greet() print($"Hello, {self.name}!") end
12
13
+new Human("John"):greet()
14
15
+```pluto title="Enum Statement Example"
16
+enum Suit do
17
+ HEARTS,
18
+ DIAMONDS,
19
+ CLUBS,
20
+ SPADES
21
22
+assert(HEARTS == 1)
23
0 commit comments