Closed johnyob closed 2 years ago
FWIW, incr
doesn't pre-increment an int ref
, it just does the increment step. Either way, you have to read the value in a separate step from incrementing it.
Can you give an example where this would be useful? I have a hard time thinking up where this might be needed in idiomatic OCaml code.
I think we're pretty unlikely to add this, so I'm closing this issue. If there is a compelling use case we might not be considering, you can reopen the issue.
As with
incr
(which pre-increments anint ref
), it would be extremely useful to have a post-increment functionpost_incr
: