[MLton] Continuations and MLton.Vector.create

Stephen Weeks MLton@mlton.org
Tue, 28 Mar 2006 16:05:29 -0800


> I agree with your argument, I guess, if tabulate does some strange
> things, but if I can mutate a vector, then I would say that the only
> solution is to not have call/cc at all.

That's not unreasonable, and is certainly how I view the situation (I
never use callcc).  But I think it's nice to have the callcc
implementation there for those who want to learn about it.  And if
someone ever wants to use callcc in serious code, they will be
motivated to build the wrapper functions.

Another way to go would be to dynamically check and report an error if
callcc is called within Vector.tabulate.  That requires
Vector.tabulate (and other callcc-unsafe functions) to set and clear a
flag, which has an acceptable performance hit.

> I admit that the fact that the stream library makes things slightly gray.

???