agora icon indicating copy to clipboard operation
agora copied to clipboard

Make increment and decrement an expression?

Open mna opened this issue 12 years ago • 1 comments

Right now the compiler allows a := b++. Either disallow this notation, or make ++ and -- expressions (and then support prefix form too?)

mna avatar Sep 07 '13 02:09 mna

Please disallow it. 'b++' is an assignment. I find assignments within expressions difficult to read and wrap my brain around. When assignments are statements, it's easy to see the sequence of events. See http://golang.org/doc/faq#inc_dec.

luther9 avatar Sep 22 '13 07:09 luther9