Re: Defaulting and syntactic shortcuts

On 7/17/07, Norman Walsh <ndw@nwalsh.com> wrote:
> When we first started working on XProc, I was strongly opposed to any
> discussion of defaulting or syntactic shortcuts. Mostly this was
> because I didn't want our design decisions to be motivated by
> affection for a particular shortcut syntax.
>
> But it was also because, as a language designer, I'm not sure
> syntactic shortcuts are a good idea. Perl's "more than one way to do
> it" philosophy not withstanding, I think a language is easier to learn
> and understand if there is, in fact, at most one way to accomplish any
> given task. Giving users more than one way to do it means users have
> to learn more than one language.
>
> So my initial principle was: no defaulting.
>
> Time passed, the glaciers advanced and receded, eventually we decided
> to allow some defaulting for connections between consecutive steps.
>
> Then my principle was: no defaulting, except for this one case.
>
> Then we added a syntactic short cut for option values, and more
> defaulting for connections, and defaulting for parameters, and
> eventually we made this a meaningful pipeline:
>
>   <p:pipeline xmlns:p="...">
>     <p:identity/>
>   </p:pipeline>
>
> (Something about which I am not without reservations, but that's
> neither here nor there.)
>
> Now I have no principle on which to base my reluctance to accept the
> merits of a particular syntactic shortcut or default. And
> unfortunately, this far down the slippery slope, I see nothing but
> smooth sailing ahead:
>
> 1. Why not allow AVTs in option/parameter values? This would,
>    arguably, simplify the language. It would increase the value of the
>    attribute syntax shortcut for option values and allow us to get rid
>    of the distinction between @value and @select on p:parameter and
>    p:option. (What is currently done with @select could be done with
>    an AVT in @value.)

hum, difficult to find a specific argument against...


>
> 2. Consider:
>
>    <p:input port="source">
>      <p:document href="foo.xml"/>
>    </p:input>
>
>    Isn't this an obvious syntactic convenience?
>
>    <p:input port="source" href="foo.xml"/>

This one could probably have no argument against....sadly

>
> 3. Consider:
>
>    <p:input port="source">
>      <p:pipe step="stepname" port="portname"/>
>    </p:input>
>
>    Isn't this an obvious syntactic convenience?
>
>    <p:input port="source" step="stepname" port="portname"/>

did you see that you have two port attribute ?

>
> 4. Consider:
>
>    <p:input port="source">
>      <p:inline>
>        <some-root>...</some-root>
>      </p:inline>
>    </p:input>
>
>    Isn't this an obvious syntactic convenience?
>
>    <p:input port="source">
>      <some-root>...</some-root>
>    </p:input>

This one is very dangerous, since we allow any foreign element to
appear anywhere

>
> I don't really want to make any of these changes, but I don't know
> what argument against them hasn't already been lost.
>
>                                         Be seeing you,
>                                           norm
>
> --
> Norman Walsh <ndw@nwalsh.com> | Nature is amoral, not immoral. [It]
> http://nwalsh.com/            | existed for eons before we arrived,
>                               | didn't know we were coming, and doesn't
>                               | give a damn about us.--Stephen J. Gould
>
>


-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 9 52 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 €

Received on Wednesday, 18 July 2007 15:58:42 UTC