mirror of
https://github.com/Dummi26/mers.git
synced 2025-12-15 03:36:16 +01:00
changed assignment parser from var = statement to statement = statement
left side of assignments can now be various different things instead of just variables. any statement that returns a reference can be used to assign to the value behind that reference. variables are automatically referenced, so the '&' can be omitted. if the variable contains a reference and that reference should be used, dereference it with *varname instead of just varname.
This commit is contained in:
10
get_ref.mers
10
get_ref.mers
@@ -1,8 +1,10 @@
|
||||
list = [1 2 3 4 5 6 7 8 9 ...]
|
||||
|
||||
second = &list.get_ref(2).assume1()
|
||||
second.debug()
|
||||
*second = 24
|
||||
second.debug()
|
||||
// second = &list.get_ref(2).assume1()
|
||||
// second.debug()
|
||||
// *second = 24
|
||||
// second.debug()
|
||||
|
||||
&list.get_ref(2).assume1() = 24
|
||||
|
||||
list.debug()
|
||||
|
||||
Reference in New Issue
Block a user