[xquery-talk] SequenceType matching in For/Some/Every expressions
Michael Kay
mhk at mhk.me.uk
Wed Sep 28 17:46:11 PDT 2005
The occurrence indicator makes sense for "let". I agree it's not useful for
for/some/every, where the variable is always a singleton item; but it
doesn't do any harm either. An orthogonal syntax often allows combinations
that aren't useful semantically.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: talk-bounces at xquery.com
> [mailto:talk-bounces at xquery.com] On Behalf Of Martin Probst
> Sent: 28 September 2005 15:01
> To: talk at xquery.com
> Subject: [xquery-talk] SequenceType matching in
> For/Some/Every expressions
>
> Hi,
> I think there is a (somewhat minor) bug in the XQuery specification
> about sequence type matching. The grammar states:
>
> [34] ForClause ::= <"for" "$"> VarName
> TypeDeclaration? ...
> [118] TypeDeclaration ::= "as" SequenceType
> [119] SequenceType ::= (ItemType OccurrenceIndicator?)
> | <"empty-sequence" "(" ")">
>
> and similar rules for Some, Every and Let. I think these rules should
> rather reference/descend directly into ItemType as the following
> statements do not make any sense to me (same for some&every):
>
> for $x as xs:string* in ...
> for $x as xs:string+ in ...
> for $x as xs:string? in ...
> for $x as empty-sequence() in ...
>
> The only thing that adds any semantic meaning is the empty-sequence()
> statement which I would interpret as "give an error if this yields
> something". But it's really cryptic and there are better ways to do
> this.
>
> Am I missing something or is this an issue? The description
> for for/let
> clauses doesn't mention occurrences at all.
>
> Martin Probst
> X-Hive Corporation
>
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
>
More information about the talk
mailing list