News for hackers. Stuff that matters.
Re:Writing a C compiler in 500 lines of Python by coldtea on Tuesday September 05, 2023 @04:22AM (#37389182)
>I wonder why =+ is so obviously a mistake

Consider

  x = -5
now how about:

  x =- 5
One makes x negative 5, the other subtracts 5 from it. And under this design of the operator the only difference is a space.

It's the same with +, just that we're not used to seeing unary plus in the wild.

Re:Writing a C compiler in 500 lines of Python by thr0w__4w4y on Wednesday September 06, 2023 @08:50AM (#37404361)
>> x =- 5

I think you mean: x -= 5, which indeed is different.

Re:Writing a C compiler in 500 lines of Python by coldtea on Wednesday September 06, 2023 @09:51AM (#37405132)
I'm showing how it would be under the original operator design which was reverted, which was "=-".