A is an array

B:=A[:]

or

B:=A

then B is a copy of A

B:=A[2:5]

then B is a pointer to A[2] (I mean when an element in B is modified, the

corresponding element in A is also modified.)

in python, its just the opposite way. why does go think its way is better?

ps:

what is the difference between B:=A[0:] and B:=A[0:6] when A has seven

elements? in the latter case, I found A modified when B is modified, while

in the former case, A is not.

my go version is 1.02 for windows.

thanks and regards,

dean

--

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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.