It should be made easy for the programmer to verify the inputs before calling the function. Is verification of the number of steps in a document done by letting this function fail, or do we supply a function that make is possible to check the available number of steps?
We receive operations from inside and outside the editor. The operations should always be checked close the point where they are received. So the cursor should have the information to know now many steps are in front of and behind it.