- From: Alex Miłowski <alex@milowski.com>
- Date: Sat, 13 Feb 2016 14:57:49 +0100
- To: XProc WG <public-xml-processing-model-wg@w3.org>
I think it needs to be a pair:
([$source],[$result]) { ... }
If you omit it, you get the declaration "([$source],[$result])" as default.
If you want no inputs or outputs, we'll need a placeholder (e.g., '_')
So, a document generator would be declared as:
(_,[$result as document-node()]){ ("d1.xml","d2.xml","d3.xml') ≫ $result }
The addition of keywords would make it more verbose but it is an
alternative that does not require a placeholder:
inputs $source outputs $result { ... }
and the generator example:
outputs $result as document-node() { ("d1.xml","d2.xml","d3.xml') ≫ $result }
On Fri, Feb 12, 2016 at 4:09 PM, Alex Miłowski <alex@milowski.com> wrote:
> We have the problem in the block expression that @1 is the output port
> and $1 is the input. Everywhere else, we use variables for outputs
> (i.e., the right hand side of an append) and then to refer to their
> use as inputs.
>
> Keep in mind that inputs are always references to some outputs - even
> the ones declared as inputs to the overall flow. We still have the
> confusing bits that inputs to the pipeline are readable outputs within
> the flow.
>
> Meanwhile, if we could name the inputs, the collision between $1 on
> the right hand side within a block expression would be removed.
> Syntax aside, we could just require block expressions to name the
> inputs:
>
> $in → [source]
> { if ($source/doc/cheese='cheddar')
> then consume() ≫ $1
> else reject() ≫ $1 }
> ≫ $out
>
> that would allow anonymous outputs as ordinals.
>
> $in → [source]
> { if ($source/doc/cheese='cheddar')
> then consume() ≫ $1
> else reject() ≫ $1 }
> ≫ $out
>
> Please keep in mind that I'm working more on the conceptual level and
> the syntax is something we'll need to decide later. So, the issues
> are:
>
> 1. Do we have ordinal inputs and outputs?
>
> 2. Do we require users to name inputs to block expressions? Is there
> a default name if they don't?
>
> 3. Do we require users to name outputs at all?
>
>
> So, we could say names default:
>
> $in → { if ($source/doc/cheese='cheddar')
> then consume() ≫ $result
> else reject() ≫ $result }
> ≫ $out
>
> --
> --Alex Miłowski
> "The excellence of grammar as a guide is proportional to the paucity of the
> inflexions, i.e. to the degree of analysis effected by the language
> considered."
>
> Bertrand Russell in a footnote of Principles of Mathematics
--
--Alex Miłowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."
Bertrand Russell in a footnote of Principles of Mathematics
Received on Saturday, 13 February 2016 13:58:18 UTC