On Jan 20, 2019, at 18:00, 伊藤和也 <kazya.ito.dr...@gmail.com> wrote:
> 
> I know "nil" is zero values for slices, maps, interfaces, etc but I don't 
> know what "nil" implays. Does nil implay the absence of value or a variable 
> has't been initialized yet or something else?

Basically yes, all of the above. This pattern dates back to C, Lisp, and other 
languages of computer science history, though many languages have different 
semantics attached. In C, NULL was just a zero pointer value that effectively 
stood for an empty/uninitialized value; in Lisp (or Python, for example, which 
has a similar None), nil is a special value of its own type that connoted an 
empty value, or false (there is similarly a “t” in Lisp which connotes the 
opposite of nil, though it is valueless).

In C, NULL values can be dangerous to play around with; in Go, some effort has 
been made to make them useful (for example, they are treated an empty arrays, 
though they are not quite the same as an empty map).


- Dave

-- 
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