File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ This language is still currently experimental with many more features to come.
23
23
* [ Loops] ( examples/loops.ls ) .
24
24
* [ Closures] ( examples/closure.ls ) .
25
25
* [ Recursion] ( examples/recursion.ls ) .
26
- * Blocks.
26
+ * [ Blocks] ( examples/blocks.ls ) .
27
27
* Printing.
28
28
* Lambda expressions/Anonymous functions.
29
29
* Static & Instance getters.
Original file line number Diff line number Diff line change
1
+ // Blocks allow variables to create isolated scopes from one another , allowing
2
+ // var to be reused for variables with the same name .
3
+
4
+ {
5
+ var x = 10 ;
6
+ print x ;
7
+ }
8
+
9
+ {
10
+ var x = "I'm in my own scope!" ;
11
+ print x ;
12
+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ func Closure() {
14
14
// Gets a function from the closure back .
15
15
var counter = Closure();
16
16
17
- // Calling counter() increments the counter .
17
+ // Calling counter() increments the counter contained within the closure .
18
18
print counter();
19
19
print counter();
You can’t perform that action at this time.
0 commit comments