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