• Robert Griesemer's avatar
    go spec: clarify semantics of range clause · 54731036
    Robert Griesemer authored
    This CL proposes some subtle language changes
    in an attempt to clarify the semantics of range
    clauses and simplify uses of maps.
    
    - nil maps behave like empty maps; but attempting
      to set a value in a nil map causes a run-time panic
    - nil channels are never ready for communication;
      sending or reading from a nil channel blocks forever
    - if there is only one index iteration variable in a
      range clause and len(range expression) would be a constant,
      the range expression is not evaluated.
      (was discrepancy with len/cap before)
    - the notion of what is a constant expression len(x)
      for (pointer to) arrays x has been generalized and
      simplified (can still be syntactically decided)
      (before: more restrictive syntactic rule that was not
      consistently implemented)
    
    Fixes #1713.
    
    R=r, rsc, iant, ken2, r2, bradfitz, rog
    CC=golang-dev
    https://golang.org/cl/4444050
    54731036
Name
Last commit
Last update
..
codelab/wiki Loading commit data...
codewalk Loading commit data...
devel Loading commit data...
gopher Loading commit data...
progs Loading commit data...
talks Loading commit data...
ExpressivenessOfGo.pdf Loading commit data...
GoCourseDay1.pdf Loading commit data...
GoCourseDay2.pdf Loading commit data...
GoCourseDay3.pdf Loading commit data...
Makefile Loading commit data...
all.css Loading commit data...
button_background.png Loading commit data...
code.html Loading commit data...
codereview_with_mq.html Loading commit data...
community.html Loading commit data...
contrib.html Loading commit data...
contribute.html Loading commit data...
docs.html Loading commit data...
effective_go.html Loading commit data...
frontpage.css Loading commit data...
gccgo_contribute.html Loading commit data...
gccgo_install.html Loading commit data...
go-logo-black.png Loading commit data...
go-logo-blue.png Loading commit data...
go-logo-white.png Loading commit data...
go_faq.html Loading commit data...
go_for_cpp_programmers.html Loading commit data...
go_mem.html Loading commit data...
go_spec.html Loading commit data...
go_tutorial.html Loading commit data...
go_tutorial.txt Loading commit data...
godocs.js Loading commit data...
htmlgen.go Loading commit data...
ie.css Loading commit data...
install.html Loading commit data...
logo-153x55.png Loading commit data...
logo.png Loading commit data...
makehtml Loading commit data...
play_overlay.png Loading commit data...
playground.html Loading commit data...
popups.js Loading commit data...
prog.sh Loading commit data...
root.html Loading commit data...
sieve.gif Loading commit data...
video-001.png Loading commit data...
video-002.png Loading commit data...
video-003.png Loading commit data...
video-004.png Loading commit data...