Scoping of options and variables

Norman Walsh <ndw@nwalsh.com> writes:
> Alex Milowski <alex@milowski.org> writes:
>
>> The consensus from the previous call (02/04/2010) was that it should
>> not be shadowed and should be an error.  That's the "strict" option in the
>> minutes from that call [1].
>>
>> [1] http://www.w3.org/XML/XProc/2010/02/04-minutes.html

Does this text adequately cover the constraint?

  The scope of option and variable names is determined by where they are
  declared. When an option is declared with p:option (or a variable with
  p:variable), unless otherwise specified, its scope consists of the
  sibling elements that follow its declaration and the descendants of
  those siblings. It is a static error (err:XS0004) if an option or
  variable declaration duplicates the name of any other option or
  variable in the same environment. That is, no option or variable may
  lexically shadow another option or variable with the same name.

I'm trying to be a little careful because a nested pipeline
declaration could be a sibling element, but that's a different
environment so it's not lexical shadowing.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | In mathematics you don't understand
http://nwalsh.com/            | things. You just get used to
                              | them.--Johann von Neumann

Received on Thursday, 11 February 2010 17:23:45 UTC