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


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

Re: Unset array doesn't work

Started byChet Ramey <chet.ramey@case.edu>
First post2018-02-28 15:14 -0500
Last post2018-02-28 15:14 -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: Unset array doesn't work Chet Ramey <chet.ramey@case.edu> - 2018-02-28 15:14 -0500

#13776 — Re: Unset array doesn't work

FromChet Ramey <chet.ramey@case.edu>
Date2018-02-28 15:14 -0500
SubjectRe: Unset array doesn't work
Message-ID<mailman.9903.1519848908.27995.bug-bash@gnu.org>
On 2/28/18 3:00 PM, Greg Wooledge wrote:

> Does unset create some kind of "placeholder" in the current function
> (but not in a caller)?

Yes, that's what I said. In the current scope, unset arranges for the
variable to appear unset. In a previous scope, unset just removes the
variable, which uncovers an instance of the variable at a (further)
previous scope.

It looks like I added that code in 1995. The code before that was "pure"
dynamic scoping, in the sense that it just removed the variable and
`uncovered' a previous scope's value no matter where the variable was
declared. It seems like I added the special case for several reasons,
but there's no indication of widespread user complaint about the behavior
of `unset'. (Of course, that was a long time ago.)

-- 
``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