NASL2 knows about uninitialized variables and have a NULL constant.
The code about addition, substraction and array indexing was rather
logical : adding or substracting anything to / from an undefined value
is undefined, and accessing an array element with an undefined index
is undefined too.
However, all this is silent and can be badly surprising.
So... Either we shout every time we try such an operation, or we
consider those undefined values as 0, at least for + - and [ ]
I was ready to vote for the 2nd option and started modifying the code,
but is this _really_ wise?
The code about addition, substraction and array indexing was rather
logical : adding or substracting anything to / from an undefined value
is undefined, and accessing an array element with an undefined index
is undefined too.
However, all this is silent and can be badly surprising.
So... Either we shout every time we try such an operation, or we
consider those undefined values as 0, at least for + - and [ ]
I was ready to vote for the 2nd option and started modifying the code,
but is this _really_ wise?