finished woo
This commit is contained in:
@@ -8,7 +8,7 @@ func aboutAnonymousFunctions() {
|
||||
}
|
||||
increment()
|
||||
|
||||
assert(i == __int__) // closures function in an obvious way
|
||||
assert(i == 2) // closures function in an obvious way
|
||||
}
|
||||
|
||||
{
|
||||
@@ -18,12 +18,12 @@ func aboutAnonymousFunctions() {
|
||||
}
|
||||
increment(i)
|
||||
|
||||
assert(i == __int__) // although anonymous functions need not always be closures
|
||||
assert(i == 1) // although anonymous functions need not always be closures
|
||||
}
|
||||
|
||||
{
|
||||
double := func(x int) int { return x * 2 }
|
||||
|
||||
assert(double(3) == __int__) // they can do anything our hearts desire
|
||||
assert(double(3) == 6) // they can do anything our hearts desire
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user