[MLton] Continuations and MLton.Vector.create
Andreas Rossberg
rossberg@ps.uni-sb.de
Wed, 29 Mar 2006 11:55:09 +0200
I've always been sceptical of call/cc. IMO it is a dangerous operation.
I consider it in the same class as a generic clone operator for copying
arbritrary (stateful) data structures. Such an operation is well-known
to break stateful abstraction, and hence is usually banned from
languages that care about abstraction, because there is no way to
protect against it.
In a somewhat similar way, call/cc allows copying control flow. This can
break all stateful abstractions that provide higher-order operations.
And there is no way to protect against that either.
I think that Vector.tabulate is just one instance of this more general
problem. Much more dangerous scenarios are possible (just consider an
iterator doing some locking).
- Andreas