|
|
|
|
|
by jimjimjim
3567 days ago
|
|
yep, c background here. it makes sense if you think about what instructions the code would get compiled to. if it didn't reuse the var's memory other people would complain that go is inefficient in loops. can't please everybody, somebody will always complain. |
|
Also (though this may be going off-topic), imagining what instructions might be emitted has been known to mislead, especially in the face of aggressive optimization (looking at the actual compiler output may give you insight into the language's semantics, but reading the language's specification is probably an easier, quicker and more reliable route.)