This commit is contained in:
mark 2023-06-04 22:15:09 +02:00
parent c9e790dae8
commit 5ce10144e7

View File

@ -58,7 +58,7 @@
* modifies the value: `x := 5 { &x = 10 debug(x) } debug(x)` prints `10` and then `10`. * modifies the value: `x := 5 { &x = 10 debug(x) } debug(x)` prints `10` and then `10`.
+ `<statement_left> = <statement_right>` + `<statement_left> = <statement_right>`
* assigns the value returned by `<statement_right>` to the value behind the reference returned by `<statement_left>`. * assigns the value returned by `<statement_right>` to the value behind the reference returned by `<statement_left>`.
* if `<statement_right>` returns `<type`>, `<statement_left>` has to return `&<type>`. * if `<statement_right>` returns `<type>`, `<statement_left>` has to return `&<type>`.
* this is why `&<var_name> = <statement>` is the way it is. * this is why `&<var_name> = <statement>` is the way it is.
+ `***<statement_left> = <statement_right>` + `***<statement_left> = <statement_right>`
* same as before, but performs dereferences: `&&&&int` becomes `&int` (minus 3 references because 3 `*`s), so a value of type `int` can be assigned to it. * same as before, but performs dereferences: `&&&&int` becomes `&int` (minus 3 references because 3 `*`s), so a value of type `int` can be assigned to it.