From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14818 invoked by alias); 16 Apr 2018 09:59:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42656 Received: (qmail 28993 invoked by uid 1010); 16 Apr 2018 09:59:55 -0000 X-Qmail-Scanner-Diagnostics: from mailout2.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.12):SA:0(-6.9/5.0):. Processed in 2.13731 secs); 16 Apr 2018 09:59:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS,T_DKIMWL_WL_HIGH,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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= X-AuditID: cbfec7f4-b4fc79c0000043e4-28-5ad47411f1fc Date: Mon, 16 Apr 2018 09:32:21 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: [PATCH] move zsh reserved words out of the way when invoked in sh/ksh emulation Message-id: <20180416093221.119adb33@camnpupstephen.cam.scsc.local> In-reply-to: <02c529b7-2247-2f42-ef32-0f9cac29a641@inlv.org> Organization: SCSC X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKIsWRmVeSWpSXmKPExsWy7djPc7qCJVeiDC7P17c42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGR33ZzIXLOOuuDJlCnMD40uOLkZODgkBE4m7E2ezdDFycQgJ rGCUWDH3KzuE08sk0bH6GDNM1f1/kxghEssYJQ6c3MkE4Uxjkrh78wFU/xlGiV0/D7NBOBcY JWZd6WEE6WcRUJVYcuQD2Cw2AUOJqZtmg8VFBLQkdpw8yQRiCwvESby9fgFoEgcHr4CzxJMF biBhTgEbiYUTj7OChPkFhCQuNNtCXGQvcXQPRCevgKDEj8n3WEBsZgEdiW3bHrND2PISm9e8 ZQY5R0JgBptE+64XUO+4SKx9uZQVwhaWeHV8CzuELSPR2XGQCaKhmVFi7f37bBCJHqBnFodC 2NYSfbcvMkJs4JOYtG06M8hxEgK8Eh1tQhAlHhI7Ft9nhLAdJS6uvQIN035GiSs3n7FNYJSf heTwWUgOn4Xk8AWMzKsYxVNLi3PTU4uN8lLL9YoTc4tL89L1kvNzNzECI//0v+NfdjDu+pN0 iFGAg1GJh3fH2ctRQqyJZcWVuYcYJTiYlUR4lyUChXhTEiurUovy44tKc1KLDzFKc7AoifPG adRFCQmkJ5akZqemFqQWwWSZODilGhh3TAy4oXViD8Pv7tqoqWJ71jBnShyVX3dNv4X1Wqb1 hJCX9o2nuiZEGkjYpSzj1zj70GJifn5x70qbDa0f2ngMZOYtPi85fdou/nVh5sdvqAf9fbSx K3alxP7Iv/FLD6fL8U4/eu954JMt3sU1afLzvhd1fp0pvebcvp8/ti/WcJ4ye0c+29RYJZbi jERDLeai4kQAc+kTQPgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsVy+t/xy7oCJVeiDC4utLE42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGR33ZzIXLOOuuDJlCnMD40uOLkZODgkBE4n7/yYxdjFycQgJ LGGU+LxjHQuEM4NJ4sXJx2wgVUIC5xgl/vTkQSQuMEq0z5vJCpJgEVCVWHLkAzOIzSZgKDF1 02xGEFtEQEtix8mTTCC2sECcxNvrF4CmcnDwCjhLPFngBhLmFLCRWDjxOCvEzImMEo8u9DKD 1PALCElcaLaFuM5e4ugeiDG8AoISPybfYwGxmYHGb97WxAphy0tsXvOWGeJOdYkbd3ezT2AU moWkZRaSlllIWhYwMq9iFEktLc5Nzy021CtOzC0uzUvXS87P3cQIDNltx35u3sF4aWPwIUYB DkYlHt4dZy9HCbEmlhVX5h5ilOBgVhLhXZYIFOJNSaysSi3Kjy8qzUktPsQozcGiJM573qAy SkggPbEkNTs1tSC1CCbLxMEp1cAYEmuwd3Z/36LV7TdEn1418/E0+yPF2phQFp3zxVB26t0p Pxc8yzTljpRK2ZrKvjN7s+1879t6SWzLzPcLf5L+9f0B66wja/jPt31Zsc2octPR5v8aO4/d m87KePbkrpmPW/YuSSmyYtJUmcv03DT9t/NKi4dLz7w6/PrA0Zps9v7WeNbu7V+alViKMxIN tZiLihMBD6zjvFUCAAA= X-CMS-MailID: 20180416095945eucas1p2bd02ee96ab682699678e2594b197d1a4 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180325222346epcas1p2296ebb2ee08e21c7438b32eabf1fa57a X-RootMTR: 20180325222346epcas1p2296ebb2ee08e21c7438b32eabf1fa57a References: <02c529b7-2247-2f42-ef32-0f9cac29a641@inlv.org> On Mon, 26 Mar 2018 00:23:07 +0200 Martijn Dekker 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