lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


steve donovan <steve.j.donovan@gmail.com> writes:

> On Tue, Jul 12, 2011 at 1:30 PM, Tony Finch <dot@dotat.at> wrote:
>> So I think it is that bad.
>
> Also, it's possible that I've led a sheltered life under a bush, but
> what would full continuations give us that we don't already have?

Incomprehensibility.  We already have goto, but it can't cross function
boundaries.

It can be used to some degree for optimization tasks involving different
execution paths depending on some choice.  I can make _both_ choices,
one after the other, and keep track of all partial executions not yet
fallen through a min-max sieve, continuing (for better estimate
boundaries) or dropping them on an as-needed base.

The optimization process itself becomes utterly incomprehensible and
intractible but tightly capsuled, but developing the various
possibilities (and their scoring) becomes easily extensible and
understandable.  And in the end result, magically all the right
decisions have been made, even though the first decisions need not
correspond with local maxima and thus interdepend with later decisions.

Basically, when you have good reason to postpone one way of finishing
some operation, in particular when you want to try finishing it in
several different, incompatible ways, continuations can be useful.

Not comprehensible in itself, but as a tool for confining the
incomprehensibility to small code paths closely watched by wizards.

-- 
David Kastrup