W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2011

Re: Shadowing of variables..

From: Chris Maloney <voldrani@gmail.com>
Date: Mon, 28 Nov 2011 08:29:39 -0500
Message-ID: <CABE9g5MQoquFMxxAV5LxqihW+Vnvq5G=GNcYSAxy2UkVVaPmeg@mail.gmail.com>
To: Geert Josten <geert.josten@dayon.nl>
Cc: Florent Georges <fgeorges@fgeorges.org>, vojtech.toman@emc.com, xproc-dev@w3.org
I agree with Florent, and would vote against it.  Especially when
considering newer programmers, or programmers who come from an imperative
programming background, immutable variables (variables that don't vary) can
be confusing.  Allowing them to redefine (shadow) an immutable variable
just makes it all the more so.  I think enforcing each variable to have a
unique name within the same scope would be in keeping with the nature of
this programming paradyme, and would help to reduce bugs, and make bugs
that do occur easier to find.
Just my two cents.

On Mon, Nov 28, 2011 at 5:58 AM, Geert Josten <geert.josten@dayon.nl> wrote:

> > > PS: what are the use cases for XSLT? ;-)
> >
> >   Honestly, I am not quite sure but I suspect this is the same
> > reason.  Maybe also to ease generating code in some cases.  But
> > I didn't say I liked it more in XSLT :-)
> Not how I meant it. It is just if this is common practice in XSLT people
> could be used to this, and expect it to behave similarly in XProc. XQuery
> allows doing similar things with let's as well, so why should XProc be
> different? ;-)
> Cheers..
Received on Monday, 28 November 2011 13:30:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:17:01 UTC