W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > April 2008

Re: Variable and option binding proposal

From: Alessandro Vernet <avernet@orbeon.com>
Date: Mon, 31 Mar 2008 23:23:06 -0700
Message-ID: <4828ceec0803312323p6e839398raaf281d4d9aeaa8c@mail.gmail.com>
To: public-xml-processing-model-wg@w3.org

On Thu, Mar 27, 2008 at 12:26 PM, Norman Walsh <ndw@nwalsh.com> wrote:
>  Given the rules about scoping, I think allowing users to put the
>  declarations anywhere they want *and* making it an error to declare
>  the same variable twice is just going to be irritating.

Is it? I don't find this surprising, and as a matter of fact we have a
similar rule in Java. (1) Java doesn't force you to declared all the
variables at the beginning of a block, but (2) you are not allowed to
write something like this either:

	public static void main(String[] args) {
		int i = 1;
		f(i);
		int i = 2;
		f(i);
	}

#2 makes even more sense with XProc than it does with Java, since
steps are not necessarily running in the order in which they are
declared.

Alex
-- 
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Received on Tuesday, 1 April 2008 06:23:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 1 April 2008 06:23:45 GMT