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

Re: Shadowing of variables..

From: Florent Georges <fgeorges@fgeorges.org>
Date: Mon, 28 Nov 2011 11:21:46 +0100
Message-ID: <CADyR_r1vCj9diN=7yD+9Xp=O+O0OqrgyugfMyt-Cw87MAA7K-w@mail.gmail.com>
To: Geert Josten <geert.josten@dayon.nl>
Cc: vojtech.toman@emc.com, xproc-dev@w3.org
On 28 November 2011 11:12, Geert Josten wrote:

  Hi,

> I see no obvious reason why to be picky about it, and require
> developers to use a p:group to shadow a variable..

> But perhaps that is just my pragmatic way of looking at it.. ;-)

  My pragmatic way of looking at it is that this prevents the compiler
to detect what is most likely an error.  I never use two variables
with the same name *at the same scope level*, and if I do that's a
typo and I want the compiler to tell me so.

  Just curious, what's the use case exactly requiring shadowing a
variable at the same level?

  Regards,

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
Received on Monday, 28 November 2011 10:22:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 28 November 2011 10:22:39 GMT