Not stupid, but you made a subtle mistake. An underscore in State_Values turns it into a Pattern , not a List . You can find this using the Head[] function.
stateValues = List[]; Length[stateValues] Length[{}] Out[11]= 0 Out[12]= 0
As you can see, this is correct and expected. Enter the underscore and it all breaks down:
state_Values = List[]; Length[state_Values] Head[state_Values] Head[stateValues] Out[16]= 2 Out[17]= Pattern Out[18]= List
It is much easier to see if you are using the graphical version of Mathematica, as it highlights Pattern variables differently.
source share