Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent and temporary assignments in variables #328

Open
MatiDragon-YT opened this issue May 22, 2024 · 1 comment
Open

Persistent and temporary assignments in variables #328

MatiDragon-YT opened this issue May 22, 2024 · 1 comment
Labels
priority:p2 Medium priority scope:compiler type:feature New feature or request
Milestone

Comments

@MatiDragon-YT
Copy link
Member

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.

@MiranDMC
Copy link

MiranDMC commented May 22, 2024

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

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

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

@x87 x87 added type:feature New feature or request priority:p2 Medium priority scope:compiler labels Aug 7, 2024
@x87 x87 added this to the v4.1.0 milestone Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p2 Medium priority scope:compiler type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants