On Tue, 12 Mar 2019 21:16:21 -0700 Lucio <lucio.d...@gmail.com> wrote:
>
> On Monday, 11 March 2019 04:55:26 UTC+2, Rob 'Commander' Pike wrote:
> >
> >
> > Whether a pointer should be declared with & or * or "ptr" or anything else 
> > is an arbitrary decision made the way it was by the Go designers because, 
> > as Ian says, C did it with *.
> >
> >>
> Not unlike "creat" or "umount", "*" rather than "&" will elicit an: "If I 
> had to do it over, I would..." comment in the distant future.

It sort of makes sense. 

C:
T *x;
typeof x == T*
typeof *x == T

T x[5];
typeof x == T[5]
typeof x[i] = T

Go:
x *T    // declaration
type x  == *T
type *x == T

x [5]T
type x  == [5]T
type x[i] == T


Funny that they "fixed" the ptr decl/use syntax symmetry but
broke it for slices/vectors!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to