The format of the assignment statement is:
lvalue = expression ;
The lvalue is things that can be placed on the left side of the assignment symbol. In Rice, they are variables, fields , expressions that end with a setter , and expressions that end with an indexer operator.
The lvalue will be changed with an instance returned by the expression on the right-hand side of the assignment symbol.
If the lvalue ends with a variable or field, changes the address referenced by the lvalue.
If the lvalue ends with a setter, it is converted to a setter call.
If the lvalue ends with an indexer operator, changes an item of corresponding list class.
The lvalue is things that can be placed on the left side of the assignment symbol.In Rice, they are variables, fields, expressions that end with a setter, and expressions that end with an indexer operator.
Assignment symbol =
It is a symbol for changing the lvalue.
The expression creates an instance that changes the lvalue. The class of the generated instance must be the same as the lvalue.
As an exception, when assigning a numeric class with a small range to a numeric class with a large range, you can assign even if both classes are different.
rr = 10L; // Assigns the long value to the real.
rr = 10; // Assigns the int value to the real.
ll = 10; // Assigns the int value to the long.
In this case, a new instance of the lvalue class is created based on the instance returned by the right side, and it is assigned.
The end of a assignment statement is represented by a semicolon.
closed setter VarSetter(int val)
var1 = val; // ♦1
open method void someMethod(int arg)
this.VarSetter = arg; // ♦2
♦1 : Lvalue is the field.
♦2 : Lvalue is the expression that ends with the setter.