mers/when_clone.mers
mark bba48b311f 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.
2023-05-12 00:44:47 +02:00

9 lines
131 B
Plaintext

&a = "value"
&list = ["a" "b" "c" ...]
&elem = &list.get_ref(1)
switch! elem {
[&string] elem.0 = "z"
[] {}
}
list.debug()