I discovered that in Julia, the const keyword is only allowed in the global scope and in structs. This means that local constants have to be represented as variables in Julia.
At the moment, we don't seem to have a way of differentiating local and global variables/constants in GOOL, so for now we have to treat constants like we do in Python, i.e. make them variables. If we add that differentiation (as discussed in #3821), then we should be able to add the const keyword when declaring global constants.
Declaring constants in structs may have other issues. If we a separate representation of structs in GOOL, the constants shouldn't cause any issues with that. If we decide to make classes work in Julia though, there would be difficulties. That discussion is a bit up in the air at the moment, so hopefully we can talk about it on Wednesday and see if we need to discuss this further.
It seems like constant variables shouldn't be too much of a hassle, once we get #3821 sorted out. Constants inside structs will depend on what we use structs for, so I'll defer that discussion until we have more of a consensus.
We should still allow things to be marked constant in drasil-code (and likely GOOL) but the renderers for some languages would ignore that (and potentially emit an inline comment to that effect).
I discovered that in Julia, the
const
keyword is only allowed in the global scope and in structs. This means that local constants have to be represented as variables in Julia.At the moment, we don't seem to have a way of differentiating local and global variables/constants in GOOL, so for now we have to treat constants like we do in Python, i.e. make them variables. If we add that differentiation (as discussed in #3821), then we should be able to add the
const
keyword when declaring global constants.Declaring constants in
struct
s may have other issues. If we a separate representation ofstruct
s in GOOL, the constants shouldn't cause any issues with that. If we decide to make classes work in Julia though, there would be difficulties. That discussion is a bit up in the air at the moment, so hopefully we can talk about it on Wednesday and see if we need to discuss this further.It seems like constant variables shouldn't be too much of a hassle, once we get #3821 sorted out. Constants inside structs will depend on what we use structs for, so I'll defer that discussion until we have more of a consensus.