W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > June 2007

Re: Composability

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Thu, 07 Jun 2007 10:33:41 +0100
To: Jeni Tennison <jeni@jenitennison.com>
Cc: public-xml-processing-model-wg@w3.org
Message-ID: <f5bps489ki2.fsf@hildegard.inf.ed.ac.uk>

Hash: SHA1

Jeni Tennison writes:

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


'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

 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

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.

- -- 
 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]
Version: GnuPG v1.2.6 (GNU/Linux)

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:32:43 UTC