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

Re: Henry's proposed syntax change

From: Alessandro Vernet <avernet@orbeon.com>
Date: Mon, 7 Jan 2008 20:06:32 -0800
Message-ID: <4828ceec0801072006p5c13084w348e56ca2a046f22@mail.gmail.com>
To: public-xml-processing-model-wg <public-xml-processing-model-wg@w3.org>

On Dec 20, 2007 7:00 AM, Richard Tobin <richard@inf.ed.ac.uk> wrote:
> [...]
> At this point, we can do everything.

Everything that precedes makes sense to me.

> p:pipeline is introduced merely
> as an abbreviation.  It's only allowed as a top-level form, and
>
> <p:pipeline ...attrs...>
>   ...content...
> </p:pipeline>
>
> is equivalent to
>
> <p:declare-step ...attrs...>
>   <p:input name="source"/>
>   <p:ouput name="result"/>
>   ...content...
> </p:declare-step>

To try an analogy with more traditional programming languages,
p:declare-step could be compared declaring a procedure in Pascal
(ignoring the outputs). Add p:pipeline to the language, is a little
bit as if Pascal we had a syntax allowing us to write:

    oneParamProcedure Print;

As an abbreviation to:

    procedure Print(source: String);

I don't think this would be desirable.

1. We don't want to have rigid principle against adding "syntactic
sugar" or "multiple ways to write the same thing" to the language, but
we should avoid those when possible. This seems to be such a case.
2. The naming seems strange: p:pipeline uses a noun and p:declare-step
a verb. Maybe using p:declare-pipeline would better convey that
p:declare-pipeline is a particular case of p:declare-step, thus
calling "pipeline" a step that has at least one input named "source"
and one output named "result" (mmh).
3. By trying to save a few keystroke to pipeline authors, I feel we
are making their life more complicated. We make the syntax of the
language more complicated, and we make code less readable by having
implied inputs and outputs when p:pipeline is used instead of
p:declare-step. This seems to be what bothers me the most with this
"syntactic sugar".

Alex
-- 
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/
Received on Tuesday, 8 January 2008 04:06:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:54 GMT