ensuringArgumentIsVarOrCharCode

Ensures the argument at index is either unbound, -1 (end-of-file), or a valid character code, as required by the "code" argument of get_code/1,2 and peek_code/1,2.

Throws

if it is bound but not an Integer.

(character_code) if it is an Integer outside the representable character-code range.