On 17/09/2015 19:31, Matthew Fluet wrote:
On Thu, Sep 17, 2015 at 6:48 AM, Phil Clayton <phil.clayton at lineone.net> wrote:
16/09/15 12:40, David Matthews wrote:
On 15/09/2015 22:18, Phil Clayton wrote:
I looked at the MLton documentation and couldn't understand what "touch" was trying to achieve. Could you explain it?
"touch t" prevents finalization of t until the call has been evaluated. "touch t" an operation that uses t to do nothing, so t cannot be garbage-collected until the operation has finished.
Essentially, yes.
Thank you both for your explanations. I was gradually getting the idea as I wrote my original question but it's good to have it confirmed.
It looks as though the most future-proof solution is to add "touch" as a primitive as you've done.
David