Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] move zsh reserved words out of the way when invoked in sh/ksh emulation
- X-seq: zsh-workers 42656
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- 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
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180416095947euoutp02c3879177bbe14ab5800bf68a851e10e2~l4jn1zXeL2010120101euoutp02Q
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1523872787; bh=spnuoY+s5bygwY2UzFHVd1+FUV6qe96cwxiZM81V3bY=; h=Date:From:To:Subject:In-reply-to:References:From; b=PWKH0qcSYbZKEi2V11w7lr4LWXNeM8Ov1nJfnYPneMaNMzEDGYPYF1Yfzi6B5bFrB 7POIF+q14iVqf0dv3qER11nQ/Ho1CY2WQmmiA0zkuC9QYsNYZjXVTu5mI9rgEhw4af j4cpcbRfKZ9mrriBTuPfPTEhKL3y8xtfAIPi13lk=
- In-reply-to: <02c529b7-2247-2f42-ef32-0f9cac29a641@inlv.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: SCSC
- References: <CGME20180325222346epcas1p2296ebb2ee08e21c7438b32eabf1fa57a@epcas1p2.samsung.com> <02c529b7-2247-2f42-ef32-0f9cac29a641@inlv.org>
On Mon, 26 Mar 2018 00:23:07 +0200
Martijn Dekker <martijn@xxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author