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
package main | |
func main() { | |
// Two new vars, with :=. | |
x, y := returns_one_and_two() | |
print("x = ", x, "\n") // 1 | |
print("y = ", y, "\n") // 2 | |
// One of the vars is new, use := for both. | |
y, z := returns_one_and_two() |
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
// Prints false, false, false, true, false, true, true, false, true. | |
package main | |
func main() { | |
for i := 0; i < 10; i++ { | |
println(doesItAlias(i)) | |
} | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
struct closure { | |
void (* call)(struct closure *); | |
int x; | |
}; |