Re:Google Go: The Good, the Bad, and the Meh
by smosher on Monday February 11, 2013 @12:03PM
(#5201799)
Two examples come to mind:
and:
If you think you must, apply sigils. The position of the brackets in the Go version is atypically bad for readability.
[ Parent
| on HN ]
Re:Google Go: The Good, the Bad, and the Meh
by Jabbles on Monday February 11, 2013 @12:14PM
(#5201861)
I don't understand.
Where do your examples say they're pointers?
How would you express this using your first syntax?
*[4]*FooType
Re:Google Go: The Good, the Bad, and the Meh
by svachalek on Monday February 11, 2013 @01:05PM
(#5202168)
The first is or could be Haskell. The length of a list is not part of its type. The second looks like Java, ditto there (although built-in arrays have a different syntax).
Haskell 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).
Re:Google Go: The Good, the Bad, and the Meh
by smosher on Monday February 11, 2013 @01:35PM
(#5202365)
Where do your examples say they're pointers?
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.