Calling Conventions and Pass By Reference

Yuval Kogman nothingmuch at
Tue Sep 2 22:53:14 BST 2008

On Wed, Sep 03, 2008 at 00:35:01 +0300, Yuval Kogman wrote:

> Every value is conceptually an infinite stream of values, so e.g.
> writing a clock widget amounts to assigning the output of some
> formatting function applied to $time, into a GUI widget. The system
> will reevaluate on any change.

I should explain that $time is a variable representing the current
value of some clock, i suppose a bit like what you get if you use
TIESCALAR and then sub FETCH { time() } in perl, except that it
doesn't stop there, and this tiedness is propagated through each
expression the value is used in.

This transformation can be expressed by using administrative normal
form as the intermediate representation, and lifting every
expression applied to a stream value into an event handler that
applies its continuation on a change. ANF guarantees that the value
dependencies are properly resolved (it's related to continuation
passing style, but it's pretty inverted).

  Yuval Kogman <nothingmuch at>  0xEBD27418

More information about the mailing list