-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand globally scoped code support significantly
- Loading branch information
Michael Phelps
committed
Jun 26, 2021
1 parent
eb3da84
commit 19cc035
Showing
7 changed files
with
228 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
var ( | ||
A = []int{1, 2, 3} | ||
B int | ||
C int | ||
D int | ||
) | ||
|
||
func init() { | ||
for i, x := range A { | ||
A[i] += x | ||
} | ||
B = A[0] | ||
C = A[0] | ||
D = 3 | ||
for C < A[2] { | ||
C += 1 | ||
} | ||
if C == A[2] { | ||
fmt.Println("True") | ||
} | ||
} | ||
|
||
func main() { | ||
fmt.Println("Main started") | ||
fmt.Println(A) | ||
fmt.Println(B) | ||
fmt.Println(C) | ||
fmt.Println(D) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
A = [1, 2, 3] | ||
|
||
for i, x in enumerate(A): | ||
A[i] += x | ||
|
||
B = A[0] | ||
C = A[0] | ||
D: int = 3 | ||
|
||
while C < A[2]: | ||
C += 1 | ||
|
||
if C == A[2]: | ||
print('True') | ||
|
||
|
||
def main(): | ||
print("Main started") | ||
print(A) | ||
print(B) | ||
print(C) | ||
print(D) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.