ensuringArgumentIsIOMode

Ensures the argument at index is one of the read/write/append atoms, as required by open/3,4's mode argument, and returns the corresponding IOMode.

Throws

if it is bound but not an atom.

(io_mode) if it is an atom but not one of IOMode.atomValues.