Yang,
In my (admittedly short) experience go often provides a way that works
and ... nothing else. If Daniel says that's the way it's done then
it's unlikely there's another way. This is a feature not a bug. It's
one of the reasons you can't take a breath, much less drink a cup of
tea while your program compiles. Personally I'll take this trade-off
and pass up elegance. In most cases (especially mine) elegance had
come to mean "comfortable", ie. like the language I used before. In a
month or so I expect to find go "comfortable" and the problem kind of
just goes away... (no pun intended) (really!) :-)
Hotei
> Thanks. However, it looks not very elegant.
> IMHO, If Go provides matlab-like array initialization, it will be better.
> For example:
> ia := [3][3]int{{1,2,3},{1,2,3},{1,2,3}}
>
> Best regards
>
> Yang
>
> 2010/5/4 Daniel Smith <
lukenin...@gmail.com>
>
>
>
>
>
> > This should work:
>
> > ia := [3][3]int{[3]int{1,2,3},[3]int{1,2,3},[3]int{1,2,3}}
>