bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Local variables overriding global constants


From: Nikolai Kondrashov
Subject: Re: Local variables overriding global constants
Date: Wed, 03 Apr 2013 11:39:46 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

Chris Down, Chris F.A. Johnson and Pierre Gaston,
thank you all for quick replies!

I now see that this is a known behavior and is considered normal by
developers.

Although, I'd say that it feels unnatural.

On 04/03/2013 11:26 AM, Pierre Gaston wrote:
  ok it has indeed been discussed, and this is a feature not a bug:

http://lists.gnu.org/archive/html/bug-bash/2012-04/msg00088.html

Ah, I see. This is the consequence of caller's variables being seen in called
functions.

So, if a function in some module relies on a global read-only variable and I
call it from a different function redefining it, the called function would see
redefined variable instead.

Thanks everyone!

Sincerely,
Nick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]