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]
Date: Sun, 24 Jan 2016 15:15:39 +0000 [thread overview]
Message-ID: <20160124151539.61155149@ntlworld.com> (raw)
In-Reply-To: <160122175301.ZM11810@torch.brasslantern.com>
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
prev parent reply other threads:[~2016-01-24 15:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-07 13:01 Segfault with zsh 5.2 Christian Neukirchen
2015-12-07 13:55 ` Peter Stephenson
2015-12-07 14:31 ` Christian Neukirchen
2015-12-07 14:36 ` Peter Stephenson
2015-12-07 14:54 ` Christian Neukirchen
2016-01-22 20:12 ` ${path[@]} in sh mode [was: Segfault with zsh 5.2] Martijn Dekker
2016-01-22 20:45 ` Martijn Dekker
2016-01-23 0:07 ` Mikael Magnusson
2016-01-23 1:08 ` Martijn Dekker
2016-01-23 1:53 ` Bart Schaefer
2016-01-24 15:15 ` Peter Stephenson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160124151539.61155149@ntlworld.com \
--to=p.w.stephenson@ntlworld.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).