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

Re: CPS in Parrot

> Dan is right when he says that we shouldn't think of them as
> plain functions and Scheme may have made a mistake there.

A contributing factor* (from a symmetry
view) may be the REPL orientation, which
leads to thinking of Expressions being
evaluated to produce Values, but if one
takes Continuations as dual to Values,

Values (1->A) are what they are, and can
be passed to a Function (A->B) to yield
a new Value (1->B), or handed off to a
Continuation (A->0) of the right shape.

Functions can act on Values, as above,
and on Continuations, as below, and can
also be composed directly, from (Z->A)
and (A->B) to (Z->B).

Continuations (A->0) are what they are,
and can be composed with a Function (Z->A)
to yield a new Continuation (Z->0), or
passed a Value (1->A) of the right shape.

  Andrzej Filinski, Declarative Continuations and Categorical Duality

Think of a spreadsheet: one enters data
into the cells (values), selects output
formats for the cells (continuations),
and puts formulae in between (functions).
For each intermediate cell, cells which
refer to it look like continuations, and
cells to which it refers, like values.


:: :: ::

* I recall at least one early AIM which
recognized Hewitt's actors as being in
a looking glass world, so the symmetry
isn't completely hidden by REPLing.

Landin makes sure to note that an ISWIM
program-point definition introduces a
"deviant" kind of function, not a plain