Current syntax
Code: Select all
variable := 5+5
variable3 := variable1 + variable2
Code: Select all
variable = 5+5
variable3 = variable1 + variable2
Current syntax
Code: Select all
variable = 5+5
Code: Select all
variable = "5+5"
Proposed syntax:
Code: Select all
stringvar = "\"Some text\""
String concatenation:
Proposed syntax:
Code: Select all
variable1 = "Text 1, "
variable2 = "Text 2"
variable3 = variable1 + variable2
Variable and text differentiation:
Current syntax:
Code: Select all
msgbox, Some text %variable%
;or use %
msgbox, % "Some text " variable
Proposed syntax:
Code: Select all
msgbox, "Some text " + variable
msgbox, "Some text " + array[1]
Here we use plus sign + as concatenation sign. In case where something is added to a string plus sign is becoming concatenation sign and every variable is treated as string value and one string is added to another.
Boolean operations:
Current syntax:
Code: Select all
variable2:= variable1 + 5
if (variable2 = variable3)
{
;some code
}
Code: Select all
if (variable1 + 5 == variable3)
{
;some code
}
Summary
1) After implementing all of this we will be able to use variables everywhere without %.
2) We need to include all strings in "" , like this "Here is some text"
3) We will be able to concatenate strings.
4) We will be able to use expressions in conditions and avoid using unnecessary variables.
5) := sign is not needed anymore.
Similar syntax is used in JavaScript.