Re: Composability

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeni Tennison writes:

> . . . I think Henry's saying that he wants dynamic scoping of options.

Right.

'eval' is a problem for programming languages in general.  I'm aware
of three approaches:

1) Dynamic scoping -- bindings go on the stack, variable references
   look up the stack, no constraints. [Shallow binding optimisation is
   possible, but doesn't change the semantics.]  Out-of-context 'eval'
   uses the dynamic bindings, _or_ closures which effectively
   encapsulate a particular binding/stack state. [Interlisp]

2) Lexical scoping -- bindings go on the stack, but variable
   references restricted to lexically containing context.
   Out-of-context 'eval' doesn't work/not allowed. [C, Java]

3) And then there's Python -- it's essentially lexically scoped, with
   a special category of 'global' variables, _and_ the ability to
   reify the local and global binding state.  Out-of-context 'eval'
   works if you use pass around the reified binding states.

It seems to me we could choose any one of these.  We already _have_ a
binding stack, namely the environment.  In practice, I see three
possibilities:

 1) Straight lexical -- variable references are possible only to
    options bound in the surrounding <p:pipeline>;

 2) Straight dynamic -- variable references are possible to any option
    with a binding in the environment, and the environment is passed
    through 'calls' to named pipelines;

 3) Pythonic -- variable references are possible to any option with a
    binding in the environment, and the environment _may_ be passed
    through 'calls' to named pipelines.  Two variants -- the caller
    decides whether the environment passes; the called pipeline
    decides.

I could live with any of these.  (1) would do for v1.  Eventually, I
think I'd like (3), with control on the side of the caller.

ht
- -- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFGZ9D6kjnJixAXWBoRAotKAJ9QZsh1pzTdLOxF1ZNc0zvy5I2M0QCfSzAa
FoIJdVacZyAix3ng0RSo5VM=
=4ng/
-----END PGP SIGNATURE-----

Received on Thursday, 7 June 2007 09:33:50 UTC