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.0 (2014-02-07) 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.0
X-Originating-IP: [82.20.18.64]
X-Spam: 0
X-Authority: v=2.1 cv=KZcvylsD c=1 sm=1 tr=0 a=tQ56d2wE10i0ATcm3CvKvA==:117
 a=tQ56d2wE10i0ATcm3CvKvA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10
 a=s5jvgZ67dGcA:10 a=NLZqzBF-AAAA:8 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8
 a=TD1fYp-b-daY7CVjO2sA:9 a=A0TpvIHJisDG1u3r:21 a=i0WkKlkPyRmcCO82:21
 a=CjuIK1q_8ugA:10
Date: Sun, 24 Jan 2016 15:15:39 +0000
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: ${path[@]} in sh mode [was: Segfault with zsh 5.2]
Message-ID: <20160124151539.61155149@ntlworld.com>
In-Reply-To: <160122175301.ZM11810@torch.brasslantern.com>
References: <87h9jujttm.fsf@gmail.com>
	<20151207135532.1a285c15@pwslap01u.europe.root.pri>
	<878u56jpob.fsf@gmail.com>
	<20151207143621.3cbbe7bd@pwslap01u.europe.root.pri>
	<56A28D28.3090701@inlv.org>
	<56A294F9.5020509@inlv.org>
	<CAHYJk3Qi-N3J2Np6w1Jqm_J+4=ip+kpGwhpQhi74L3osmfnYgw@mail.gmail.com>
	<56A2D27A.1050807@inlv.org>
	<160122175301.ZM11810@torch.brasslantern.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 37763

On Fri, 22 Jan 2016 17:53:01 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Jan 23,  1:08am, Martijn Dekker wrote:
> }
> } > If you're in a function context, you can say 'typeset -h path' to hide
> } > the specialness of $path and declare a new local of the same name. Eg,
> } > one that isn't connected to PATH.
> } 
> } It would be nice if that worked globally too, and even nicer if it were
> } automatically done by 'emulate sh' (or ksh for that matter) and undone
> } by 'emulate zsh'. But that might be non-trivial and the developers may
> } have other priorities.
> 
> It's non-trivial.  The emulate command only deals with setopts, not with
> keywords, parameters, etc.

One minor bonus worth nothing is that you don't need to use the "-h" in
the function.  You can tell the special itself that it's to be hidden by
a local:

% typeset -h path
% foo() { integer path=43; print ${(t)path}; }
% foo
integer-local
% print ${(t)path}
array-unique-hide-special

pws

