Re: Variable and option binding proposal

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 UTC