This is a common problem in languages which allow the use of "not set" or "not found" indicators as an rvalue, which (sadly) is most of them. Put another way, Python's 'None' or Perl's 'undef' conflate the notion of 'something which has never been set' with the bottom (null) value, aka. the notion of 'the thing here is empty or not useful/usable'. That's a sad conflation to make because it confuses temporal/procedural effects (what
has previously been done to this variable?) with contents (does this variable
contain a usable value?)
JavaScript takes this to an even more ludicrous place by having both 'null' and 'undefined', putting them close to each other in the truth table, and allowing them both as rvalues.
Does anyone know of any procedural programming languages (or at least languages that encourage mutation, initialization-without-assignment, and rebinding) that have a) a special value for 'never accessed' and b) do not allow that value to be set, only read?