- Why do they have the strange syntax they have
They don’t–there’s no inherent strange syntax to them. The syntax
comes from the language implementing the continuation semantics.
Like Hal said, I meant why do they have the strange syntax they do “in Ruby”.
There just doesn’t seem to be a good reason for a block. It also seems
strange to have a class with no constructor that can only be created by a
Kernel method.
Is there some reason that Continuation.new couldn’t work?
Well… no. that’s not quite right. There’s rather more to
continuations than just that. Continuations are more a Location with
Environment and History. Closures are Locations with Environment, and
Functions are just Locations.
Ok, thanks. That’s a good simplification of what I think I meant to say.
It’s generally considered Really Evil to look at anything inside a
continuation. Darned useful, though…
I like being evil.
I can imagine it being truly evil to be able to change a Continuation, but
it doesn’t strike me as terribly evil to look inside them. Even if the only
(programmer accessible) extra information them was similar to what you get
out of Kernel.caller. That way you could say something like:
puts “About to call the continuation %p” % the_continuation
And get something useful out of it.
Comments?
Ben
···
On Wed August 6 2003 6:45 pm, Dan Sugalski wrote: