move
move copied to clipboard
[Feature Request] support public const
🚀 Feature Request
support public const
Motivation
Easy to export shared const
Pitch
Additional context
public const CONST_1 : u64 = 400001;
public(friend) const CONST_2: u64 = 400001;
I can confirm that this will be pretty helpful. Currently, if we want to export any shared constants, we will need to write a public function which can be tedious.
This is a very popular request. I want to point out that it is not trivial because Move supports incremental upgrade of code. So if M uses a constant in M', and and M' is upgraded, we expect M to see any new value of that constant.
I think the most realistic way to look at constants is to understand them as syntactic sugar for parameter-less functions. @sbh @tnowacki
@alinush