4 ms·
The problem is if you pass an offset which the user has not yet input to, you're either going to have to abort or return an error of some kind. If the user inpu
by sparkie 2y ago
The problem is if you pass an offset which the user has not yet input to, you're either going to have to abort or return an error of some kind. If the user inputs to this location later, and you read from it, you've broke referential transparency because you called the same function with the same arguments twice and got a different result.
- Groxx 2y agoWhy would you have to error, or retain the offset? Block until that input exists, and/or return a higher offset to use for the next call - perhaps add the length of error message so you essentially can't guess and have to show the error has been checked. It doesn't have to match the underlying bytes, it's just a progress marker.