sannybuilder/dev

Persistent and temporary assignments in variables

Opened this issue · 1 comments

The compiler understands when to make these assignments on the lines

var++

=>

var += 1

but only if it is the only instruction in the line.
My idea is to expand its usefulness to other parts of the code.
to be used in Classes and Keywords.

Compiled before the line

Car.Exist(0@(++1@,10i))

=> 

1@ += 1
Car.Exist(0@(1@,10i))

Compiled after the line

Actor.Angle = 1@++

=>

Actor.Angle = 1@
1@ += 1.0

Compiled before and after the line

wait 1@+10

=>

1@ += 10
wait 1@
1@ -= 10

utility increases at this point.

foo(0@, ++0@) now what?

1@ += 10
wait 1@
1@ -= 10

This would be useful, but how to solve 0@ = foo(0@ + 10)