mna / agora

a dynamically typed, garbage collected, embeddable programming language built with Go
https://github.com/mna/agora/wiki
BSD 3-Clause "New" or "Revised" License
324 stars 27 forks source link

Make increment and decrement an expression? #5

Open mna opened 10 years ago

mna commented 10 years ago

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

luther9 commented 10 years ago

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.