Go's declaration syntax is one of the best things about the language. I thought it would take me forever to get used to, but within a day it was the opposite: C feels backwards. It's especially excellent for references to functions.
[1] http://golang.org/doc/articles/gos_declaration_syntax.html
Simpler variables are declared as
var a int
or with type inference: var a = 10 [FooType]
and: Slice<FooType>
If you think you must, apply sigils. The position of the brackets in the Go version is atypically bad for readability.Where do your examples say they're pointers?
How would you express this using your first syntax?
*[4]*FooTypeHaskell does not have mutability at all and thus no "pointers". In Java the insides of containers are mutable so you'd have to add an outer array or list. In either case though you don't need pointers to simply pass things around as you do in C (I don't know about Go).
They don't, it's inferred in my examples. Like I said, if you need them, you can use whatever sigils you want. They can go in front of the types as usual.
How would you express this using your first syntax?
I wouldn't. That syntax is decidedly inappropriate for vectors that incorporate length into the type.
var foo *[]*FooType
http://news.ycombinator.com/formatdoc
Aside: What's with the completely defective comment syntax on HN? Can anyone give some hints on how to quote and how to escape the star character?
edit: formatting, thanks spacemanaki