From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] move zsh reserved words out of the way when invoked in sh/ksh emulation
Date: Mon, 16 Apr 2018 09:32:21 +0100 [thread overview]
Message-ID: <20180416093221.119adb33@camnpupstephen.cam.scsc.local> (raw)
In-Reply-To: <02c529b7-2247-2f42-ef32-0f9cac29a641@inlv.org>
On Mon, 26 Mar 2018 00:23:07 +0200
Martijn Dekker <martijn@inlv.org> wrote:
> Meanwhile, I've identified five other reserved words that are unique
> to zsh *and* are perfectly plausible function names, so could kill an
> sh or ksh/bash script:
>
> end
> float
> foreach
> integer
> nocorrect
>
> So I think they (and 'repeat') should be disabled if zsh is invoked in
> sh or ksh emulation mode.
As far as I can see this isn't a particularly big deal as long a
properly documented seeing as "enable -r" works OK if people want
to mix code in emulation mode (in which case they can expect
to have the odd extra hoop to jump through).
> 'float' and 'integer' are part of the typeset family, so the
> underlying builtins would be exposed. It would then be inconsistent
> not to do the same with the rest of the typeset family:
>
> declare
> export
> local
> readonly
> typeset
>
> Thankfully, the KSH_TYPESET option still works. It should revert to
> being automatically enabled for ksh emulation and not for sh
> emulation, as in zsh up to 5.0.8.
This is when I got really confused when I first saw this patch. This
breaks the syntax supporting inline parentheses present in POSIX mode
like any other and replaces it with what was always a kludge (though
does remain useful in certain cases), and furthermore doesn't have any
clear functional motivation. So my eyes just glazed over.
pws
next prev parent reply other threads:[~2018-04-16 9:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20180325222346epcas1p2296ebb2ee08e21c7438b32eabf1fa57a@epcas1p2.samsung.com>
2018-03-25 22:23 ` Martijn Dekker
2018-04-15 21:30 ` Martijn Dekker
2018-04-16 8:32 ` Peter Stephenson [this message]
2018-04-16 21:26 ` 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=20180416093221.119adb33@camnpupstephen.cam.scsc.local \
--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).