Skip to content

Commit 21f391a

Browse files
Fix scope example in Sentinel for loops (#1093)
1 parent 3cbe8c8 commit 21f391a

File tree

19 files changed

+76
-19
lines changed
  • content/sentinel
    • v0.13.x/content/sentinel/docs/language
    • v0.14.x/content/sentinel/docs/language
    • v0.15.x/content/sentinel/docs/language
    • v0.16.x/content/sentinel/docs/language
    • v0.17.x/content/sentinel/docs/language
    • v0.18.x/content/sentinel/docs/language
    • v0.19.x/content/sentinel/docs/language
    • v0.20.x/content/sentinel/docs/language
    • v0.21.x/content/sentinel/docs/language
    • v0.22.x/content/sentinel/docs/language
    • v0.23.x/content/sentinel/docs/language
    • v0.24.x/content/sentinel/docs/language
    • v0.25.x/content/sentinel/docs/language
    • v0.26.x/content/sentinel/docs/language
    • v0.27.x/content/sentinel/docs/language
    • v0.28.x/content/sentinel/docs/language
    • v0.29.x/content/sentinel/docs/language
    • v0.30.x/content/sentinel/docs/language
    • v0.40.x/content/sentinel/docs/language

19 files changed

+76
-19
lines changed

content/sentinel/v0.13.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ The body of a `for` statement creates a new
7272
[scope](/sentinel/language/scope). If a variable is assigned within
7373
the body of a for statement that isn't assigned in a parent scope,
7474
that variable will only exist for the duration of the body execution.
75+
If the variable exists in the parent scope, assigning the variable a
76+
value in the body of a `for` statement updates it in the parent
77+
scope.
7578

7679
Example:
7780

@@ -89,5 +92,5 @@ for list as value {
8992
a = 42
9093
}
9194
92-
print(a) // 18
95+
print(a) // 42
9396
```

content/sentinel/v0.14.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ The body of a `for` statement creates a new
7272
[scope](/sentinel/language/scope). If a variable is assigned within
7373
the body of a for statement that isn't assigned in a parent scope,
7474
that variable will only exist for the duration of the body execution.
75+
If the variable exists in the parent scope, assigning the variable a
76+
value in the body of a `for` statement updates it in the parent
77+
scope.
7578

7679
Example:
7780

@@ -89,5 +92,5 @@ for list as value {
8992
a = 42
9093
}
9194
92-
print(a) // 18
95+
print(a) // 42
9396
```

content/sentinel/v0.15.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ The body of a `for` statement creates a new
7272
[scope](/sentinel/language/scope). If a variable is assigned within
7373
the body of a for statement that isn't assigned in a parent scope,
7474
that variable will only exist for the duration of the body execution.
75+
If the variable exists in the parent scope, assigning the variable a
76+
value in the body of a `for` statement updates it in the parent
77+
scope.
7578

7679
Example:
7780

@@ -89,5 +92,5 @@ for list as value {
8992
a = 42
9093
}
9194
92-
print(a) // 18
95+
print(a) // 42
9396
```

content/sentinel/v0.16.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ The body of a `for` statement creates a new
7272
[scope](/sentinel/language/scope). If a variable is assigned within
7373
the body of a for statement that isn't assigned in a parent scope,
7474
that variable will only exist for the duration of the body execution.
75+
If the variable exists in the parent scope, assigning the variable a
76+
value in the body of a `for` statement updates it in the parent
77+
scope.
7578

7679
Example:
7780

@@ -89,5 +92,5 @@ for list as value {
8992
a = 42
9093
}
9194
92-
print(a) // 18
95+
print(a) // 42
9396
```

content/sentinel/v0.17.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ The body of a `for` statement creates a new
7272
[scope](/sentinel/language/scope). If a variable is assigned within
7373
the body of a for statement that isn't assigned in a parent scope,
7474
that variable will only exist for the duration of the body execution.
75+
If the variable exists in the parent scope, assigning the variable a
76+
value in the body of a `for` statement updates it in the parent
77+
scope.
7578

7679
Example:
7780

@@ -89,5 +92,5 @@ for list as value {
8992
a = 42
9093
}
9194
92-
print(a) // 18
95+
print(a) // 42
9396
```

content/sentinel/v0.18.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ The body of a `for` statement creates a new
7171
[scope](/sentinel/language/scope). If a variable is assigned within
7272
the body of a for statement that isn't assigned in a parent scope,
7373
that variable will only exist for the duration of the body execution.
74+
If the variable exists in the parent scope, assigning the variable a
75+
value in the body of a `for` statement updates it in the parent
76+
scope.
7477

7578
Example:
7679

@@ -88,5 +91,5 @@ for list as value {
8891
a = 42
8992
}
9093
91-
print(a) // 18
94+
print(a) // 42
9295
```

content/sentinel/v0.19.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ The body of a `for` statement creates a new
7171
[scope](/sentinel/language/scope). If a variable is assigned within
7272
the body of a for statement that isn't assigned in a parent scope,
7373
that variable will only exist for the duration of the body execution.
74+
If the variable exists in the parent scope, assigning the variable a
75+
value in the body of a `for` statement updates it in the parent
76+
scope.
7477

7578
Example:
7679

@@ -88,5 +91,5 @@ for list as value {
8891
a = 42
8992
}
9093
91-
print(a) // 18
94+
print(a) // 42
9295
```

content/sentinel/v0.20.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ The body of a `for` statement creates a new
7171
[scope](/sentinel/language/scope). If a variable is assigned within
7272
the body of a for statement that isn't assigned in a parent scope,
7373
that variable will only exist for the duration of the body execution.
74+
If the variable exists in the parent scope, assigning the variable a
75+
value in the body of a `for` statement updates it in the parent
76+
scope.
7477

7578
Example:
7679

@@ -88,5 +91,5 @@ for list as value {
8891
a = 42
8992
}
9093
91-
print(a) // 18
94+
print(a) // 42
9295
```

content/sentinel/v0.21.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ The body of a `for` statement creates a new
7171
[scope](/sentinel/language/scope). If a variable is assigned within
7272
the body of a for statement that isn't assigned in a parent scope,
7373
that variable will only exist for the duration of the body execution.
74+
If the variable exists in the parent scope, assigning the variable a
75+
value in the body of a `for` statement updates it in the parent
76+
scope.
7477

7578
Example:
7679

@@ -88,5 +91,5 @@ for list as value {
8891
a = 42
8992
}
9093
91-
print(a) // 18
94+
print(a) // 42
9295
```

content/sentinel/v0.22.x/content/sentinel/docs/language/loops.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ The body of a `for` statement creates a new
7171
[scope](/sentinel/language/scope). If a variable is assigned within
7272
the body of a for statement that isn't assigned in a parent scope,
7373
that variable will only exist for the duration of the body execution.
74+
If the variable exists in the parent scope, assigning the variable a
75+
value in the body of a `for` statement updates it in the parent
76+
scope.
7477

7578
Example:
7679

@@ -88,5 +91,5 @@ for list as value {
8891
a = 42
8992
}
9093
91-
print(a) // 18
94+
print(a) // 42
9295
```

0 commit comments

Comments
 (0)