Is there a reason why `const` is not supported in...
# scripting
h
Is there a reason why
const
is not supported in scripts?
i
For now, you can think of script like of a class. All properties you define in script are member properties and not top-level ones. But const properties have the following requirement:
It must be a top-level property, or a member of an object declaration or a companion object.
So, that's the reason. Const properties may become available in scripts in the future, but only after scripts redesign.
It's also about all other things like non-inner classes with the references to the script properties or methods
h
Thanks for the clarification. I guess many users will have a different mental model when thinking about a script, which is typically (in other languages) a less structured concept.
i
Of course, it needs to be redesigned. We keep this in mind
👍 1
m
Hmm does it? I'm using scripting OK, nothing about the design seemed wildly wrong to me. It could use some more love and development but it'd be a pity if you started again from scratch.