Incorrect optimisig compilation strategy

BlitzPlus Forums/BlitzPlus Programming/Incorrect optimisig compilation strategy

_PJ_(Posted 2015) [#1]
It appears as though

Const Foobar=0

Const As_Foobar=Foobar


Compiles as two completely separately retained values, contrary to the notion of 'Constant' variables.
Is this to be expected?


Floyd(Posted 2015) [#2]
I guess it wastes four bytes of memory.

In the old days it was important to save every byte, so compilers went to great lengths to ensure that a string like "Error!" was stored only once even when used many times. Maybe they still do because it is traditional, not because it is really worth doing.

At current 2015 prices RAM is about half a penny per megabyte, so not worth worrying about. The only important characteristic of constants is that their value cannot change.