Linked by kragil on Wed 23rd Jan 2013 20:26 UTC
Permalink for comment 550241
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
Features
Linked by Thom Holwerda on 06/13/13 14:35 UTC
Linked by Thom Holwerda on 06/11/13 17:07 UTC
Linked by Thom Holwerda on 06/10/13 23:13 UTC
Linked by Thom Holwerda on 06/08/13 14:57 UTC
Linked by Thom Holwerda on 06/07/13 11:40 UTC
Linked by Thom Holwerda on 06/04/13 12:45 UTC
Linked by nfeske on 05/31/13 10:12 UTC
Linked by Thom Holwerda on 05/29/13 16:59 UTC
Linked by Thom Holwerda on 05/24/13 17:26 UTC
Linked by Thom Holwerda on 05/21/13 21:38 UTC
More Features »
Sponsored Links



Member since:
2010-03-11
I'm not comparing it with JavaScript or C#. I was just showing that it's a 1-to-1 match with how you'd normally write a function that returns a function that computes successive Fibonacci numbers.
Though since you mention it, the JavaScript version looks identical as well.
function fib() {
var a = 0; var b = 1;
return function() {a = b; b = b + 1; return a;};
}
How's pointer or array syntax weird?
func f() []int {...}
func f() *int {...}
There's nothing weird about those signatures.
Array initialization is almost exactly like C:
[]int{1,2,3,4}