[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "unset var" pops var off variable stack instead of unsetting it
From: |
Dan Douglas |
Subject: |
Re: "unset var" pops var off variable stack instead of unsetting it |
Date: |
Tue, 21 Mar 2017 02:19:21 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 03/18/2017 12:19 PM, Chet Ramey wrote:
> On 3/17/17 6:35 PM, Dan Douglas wrote:
>
>> The problem is the non-obvious nature of unset's interaction with scope,
>> (and the lack of documentation). Not much can be done about the former,
>> as it is with so many things.
>
> How would you suggest improving the documentation? I can see highlighting
> the fact that unset applied to a local variable at the same scope
> preserves the local attribute. What else?
>
The effect of unset on a local was what I had in mind, but really the
manual says very little about scope. All it says right now is:
"Variables local to the function may be declared with the local builtin
command. Ordinarily, variables and their values are shared between the
function and its caller."
Which doesn't exactly describe dynamic scope even for those that know
what that means.
Also not documented is how a variable declared with declare/typeset is
distinct from an unset variable.
- Re: "unset var" pops var off variable stack instead of unsetting it, (continued)
- Re: "unset var" pops var off variable stack instead of unsetting it, Chet Ramey, 2017/03/18
- Re: "unset var" pops var off variable stack instead of unsetting it, Eric Blake, 2017/03/20
- Re: "unset var" pops var off variable stack instead of unsetting it, Chet Ramey, 2017/03/20
- Re: "unset var" pops var off variable stack instead of unsetting it, Stephane Chazelas, 2017/03/20
- Re: "unset var" pops var off variable stack instead of unsetting it, Chet Ramey, 2017/03/20
- Re: "unset var" pops var off variable stack instead of unsetting it, Stephane Chazelas, 2017/03/21
- Re: "unset var" pops var off variable stack instead of unsetting it, Martijn Dekker, 2017/03/22
Re: "unset var" pops var off variable stack instead of unsetting it, Chet Ramey, 2017/03/18
Re: "unset var" pops var off variable stack instead of unsetting it, Chet Ramey, 2017/03/18
Re: "unset var" pops var off variable stack instead of unsetting it, Peter & Kelly Passchier, 2017/03/19
Re: "unset var" pops var off variable stack instead of unsetting it, 渡邊裕貴, 2017/03/20
Re: "unset var" pops var off variable stack instead of unsetting it, Stephane Chazelas, 2017/03/20