Discussion:
Typeswitch - scope of variables
(too old to reply)
Ihe Onwuka
2014-03-14 11:08:03 UTC
Permalink
I cannot discern from the specification what the scope of variables
introduced in the operand expression should be. Yes I can to see if
they are but such an experiment would not adjudicate specification
conformance, would it.

Fleshing it out for clarification (and possible misinterpretation on
my part). Since an operand expression can be FLOWR, are any lets
introduced therein within the scope of the case clauses of the
typeswitch expression?
Michael Kay
2014-03-14 11:54:53 UTC
Permalink
Post by Ihe Onwuka
I cannot discern from the specification what the scope of variables
introduced in the operand expression should be.
Same as in any other expression. E.g. if the operand expression is a FLWOR expression, you go to the rules for a FLWOR expression, e.g. the let clause, and the rules for the let clause say

The scope of a bound variable includes all subexpressions of the containing FLWOR that appear after the variable binding.

[I think we can read "includes" here as "comprises", i.e. it includes nothing other than these subexpressions]

Clearly the case clauses of the typeswitch are not subexpressions of this FLWOR so they are not within the scope of a variable introduced by such a let clause.

Michael Kay
Saxonica
Post by Ihe Onwuka
Yes I can to see if
they are but such an experiment would not adjudicate specification
conformance, would it.
Fleshing it out for clarification (and possible misinterpretation on
my part). Since an operand expression can be FLOWR, are any lets
introduced therein within the scope of the case clauses of the
typeswitch expression?
_______________________________________________
http://x-query.com/mailman/listinfo/talk
Continue reading on narkive:
Loading...