V Forum

[ log in ]

mut variable mut value

dcurrie 2019-06-12 13:46
It is inconsistent that `mut` before a variable declaration sometimes means that the variable can be modified by assignment, and other times means that the value can be modified. This is also mentioned on https://github.com/vlang/v/issues/41#issuecomment-480492407

Is there any way to control whether the `mut` applies to the variable or the value? It seems to me that if it applies to the value it should be on the right side of `:=`
medvednikov 2019-06-12 16:59
Yes, this is a problem. I haven't done enough research yet to come up with a good solution.
wen-jianbao 2019-06-17 06:30
I very am the anticipation ,,,

Powered by Vorum, open-source blogging/forum software written in V