neilsf / XC-BASIC

A compiling BASIC dialect for the Commodore-64
https://xc-basic.net/
MIT License
74 stars 15 forks source link

Invert sign of a numeric variable #126

Closed EmanueleBonin closed 3 years ago

EmanueleBonin commented 3 years ago

If i use this syntax : let v=1 let v=-v

Compiler return an error like this: failure at line 1, col 5, after " v=1\nlet v" expected "anything but \"=\""

the workaround is : let v=1 let v=0-v

exists a more elegant way or is this the right way ?

neilsf commented 3 years ago

The unary - operator was dropped somewhere in version 0.9 and has not been re-implemented since. Hopefully I can add it again in version 3.

neilsf commented 3 years ago

Duplicate of #40