zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: PATCH: Ghastly typeset -p array hack finally bites the dust
Date: Fri, 04 Dec 2015 17:56:56 +0000	[thread overview]
Message-ID: <20151204175656.6291faeb@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <151204092923.ZM16137@torch.brasslantern.com>

On Fri, 04 Dec 2015 09:29:23 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> So we're just going to ignore the possibility that the typeset keyword
> has been disabled?

Yes, I think it's a "so don't do that, then".  We don't generally check
if something's enabled before outputting code that uses it.  Also, there
are already assumptions built into the use of "typeset -p" output that
the shell is in a pristine state e.g. the readonly parameters don't yet
exist.

> I'm fine with that, as long as it's explicitly acknowledged.  Also the doc
> should contain a warning about this side-effect of disable, someplace.

diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 49806e4..120ec82 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1812,7 +1812,10 @@ this means.
 Note that each interface to any of the commands my be disabled
 separately.  For example, `tt(disable -r typeset)' disables the reserved
 word interface to tt(typeset), exposing the builtin interface, while
-`tt(disable typeset)' disables the builtin.
+`tt(disable typeset)' disables the builtin.  Note that disabling the
+reserved word interface for tt(typeset) may cause problems with the
+output of `tt(typeset -p)', which assumes the reserved word interface is
+available in order to restore array and associative array values.
 
 If the shell option tt(TYPESET_SILENT) is not set, for each remaining
 var(name) that refers to a parameter that is already set, the name and

pws


  reply	other threads:[~2015-12-04 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 15:34 Peter Stephenson
2015-12-04 17:29 ` Bart Schaefer
2015-12-04 17:56   ` Peter Stephenson [this message]
2015-12-04 18:06     ` "disable typeset" (was Re: PATCH: Ghastly typeset -p array hack finally bites the dust) Bart Schaefer

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=20151204175656.6291faeb@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.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).