Harding, James wrote:
The name ST_MODE in this example is not a bindable name. The name only lives during compilation and is not accessible at run-time.
I don't think that's a good idea. It would be better for it to be available at run time like a normal module-level name, but protected from rebinding.
There may be cases where the compiler can't work out the value, such as when the module is imported dynamically. Such code would then continue to work, it just wouldn't be optimised.
Not having the name present at run time could also lead to unexpected results. If something tries to rebind the name, it will succeed, but it won't affect compiler-optimised code using the name. It would be better if attempting to rebind a const name raised an exception.