Re: Another take on versioning

"Henry S. Thompson" <ht@inf.ed.ac.uk> writes:
> amounts to doing it at the semantic level.  Use C interop best
> practice as your guide, and do it at the syntactic (== #ifdef) level.

Yes. In XSLT this is "use-when":

  http://www.w3.org/TR/xslt20/#conditional-inclusion

> Specifically, add a _new_ element, call it p:switch, which looks
> like this:
>
>  <p:switch>
>   <p:version case="....">
>    sub-pipeline
>   </p:version>
>   <p:version case="....">
>    sub-pipeline
>   </p:version>
>  </p:switch>
>
> [Names of elts and attrs, of course, subject to negotiation]

We don't even have to do that, you don't need a wrapper:

  <p:xslt use-when="system-property('p:version') = '1.0'">
     whatever the 1.0 is
  </p:xslt>

  <p:xslt use-when="system-property('p:version') &gt; '1.0'">
    whatever the 2.0 is
  </p:xslt>

The rules for use-when are that it has to be possible to evaluate the
expression statically, with no context node. If the effective boolean
value is "false", the element and all its descendants are removed from
the pipeline. This all happens "at load time" before static analysis.

We could do this with or without the rules that have been proposed for
how to handle new input and output ports, options, etc. in
forwards-compatible mode.

If we do it without the rules, then every use of the new ports and
options has to be guarded. But that can be done at the very top level
if it becomes too tedious in the pipeline:

  <p:library>
    <p:import use-when="system-property('p:version') = '1.0'"
              href="v1steps.xpl"/>
    <p:import use-when="system-property('p:version') &gt; '1.0'"
              href="v2steps.xpl"/>
  </p:library>

I didn't make this proposal because it so clearly sends us back to last
call.

But maybe that's where we're going anyway.

  LC on 20 Oct
  CR on 24 Nov
  PR on 31 Dec

Maybe we still finish this year. Maybe. :-/

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | It is a folly to expect men to do all
http://nwalsh.com/            | that they may reasonably be expected to
                              | do.--Archbishop Whately

Received on Tuesday, 13 October 2009 15:52:55 UTC