Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14904 > unrolled thread

Re: issues with nameref resolution loop in a function

Started byChet Ramey <chet.ramey@case.edu>
First post2018-12-11 14:36 -0500
Last post2018-12-11 14:36 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: issues with nameref resolution loop in a function Chet Ramey <chet.ramey@case.edu> - 2018-12-11 14:36 -0500

#14904 — Re: issues with nameref resolution loop in a function

FromChet Ramey <chet.ramey@case.edu>
Date2018-12-11 14:36 -0500
SubjectRe: issues with nameref resolution loop in a function
Message-ID<mailman.5598.1544557033.1284.bug-bash@gnu.org>
On 12/8/18 8:30 PM, Grisha Levit wrote:
> There seems to be an issue with the following new bash-5.0 feature:
> 
>   A nameref name resolution loop in a function now resolves to a variable by
>   that name in the global scope.
> 
> [ Note: "warning: x: circular name reference" messages omitted below. ]
> 
> While referencing such a nameref works as described, scalar assignment to it
> modifies the variable from the next higher scope rather than the global one:

Yes, that's what it does right now. The resolution change is the only one I
made, and I'm still not convinced it's the right thing. The code that does
the assignment is unchanged, with a comment that says backwards
compatibility.

That code can operate on the global instance, ignore the nameref attribute
and change the value, or just ignore the variable as if it didn't exist.
Right now it does what it did in bash-4.4.

(Cue Greg and his "nameref variables are an unworkable botch and should
just be ignored.")

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web