Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.1
X-Originating-IP: [82.20.18.64]
X-Spam: 0
X-Authority: v=2.1 cv=aIwN0uJm c=1 sm=1 tr=0 a=tQ56d2wE10i0ATcm3CvKvA==:117
 a=tQ56d2wE10i0ATcm3CvKvA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10
 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=_r6rMTCbnzryBkf5UJ0A:9
 a=CjuIK1q_8ugA:10
Date: Sun, 7 Feb 2016 19:08:22 +0000
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: unset "hash[key]" isn't matched with what "key" may be
Message-ID: <20160207190822.7ba8de0e@ntlworld.com>
In-Reply-To: <CAKc7PVBXd-UGwM+_tRSwuw-WL154YaTys6-t3iuzfAsG-RC-YQ@mail.gmail.com>
References: <CAKc7PVBXd-UGwM+_tRSwuw-WL154YaTys6-t3iuzfAsG-RC-YQ@mail.gmail.com>
X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Seq: zsh-workers 37906

On Sun, 7 Feb 2016 15:16:05 +0100
Sebastian Gniazdowski <sgniazdowski@gmail.com> wrote:
> I had a loop in which I browsed $functions, setting:
> 
>                 func[$i]=1
> 
> where "func" is a hash and "$i" is ${(k)functions}. This worked, however this:
> 
>                 unset "func[$i]"

Not sure what you're doing, but it's apparently not equivalent to the
following, which appears to work.  There may be some relevant option,
I suppose.

% i='${(k)functions}'
% typeset -A hash
% hash[$i]=1
% print ${(kv)hash}
${(k)functions} 1
% unset "hash[$i]"
% print ${(kv)hash}
<this line intentionally left blank>

PWS

