From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11943 invoked by alias); 21 Nov 2010 17:03:02 -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: X-Seq: 28427 Received: (qmail 15075 invoked from network); 21 Nov 2010 17:02:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.49 as permitted sender) Message-Id: <201011211702.oALH2ci6003141@pws-pc.ntlworld.com> From: Peter Stephenson To: zsh-workers@zsh.org (Zsh hackers list) Subject: Re: PATCH: bash-style substrings & subarrays In-Reply-To: Your message of "Sat, 20 Nov 2010 22:34:01 PST." <101120223401.ZM6950@torch.brasslantern.com> Date: Sun, 21 Nov 2010 17:02:38 +0000 X-Cloudmark-Analysis: v=1.1 cv=JvdXmxIgLJv2/GthKqHpGJEEHukvLcvELVXUanXFreg= c=1 sm=0 a=KG8k_i-9y-sA:10 a=NLZqzBF-AAAA:8 a=vcZoGMfJ0x9iqIY2vDoA:9 a=_sWUAlVQANGN8ue98exWKZClzFwA:4 a=_dQi-Dcv4p4A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Bart Schaefer wrote: > } I don't think half-measures compatibility with other shells is > } particularly useful, in the end is probably more confusing when you > } find some things work the way you expect and some things don't. > > I'm confused about how that relates to the foregoing, sorry ...? If KSH_ARRAYS is not set, lots of aspects of arrays don't work in a fashion consistent with other shells, so the fact that one feature you chanced upon does so, doesn't help you write scripts properly. If you want proper compatibility you need a full emulation. This doesn't impinge on the argument for saying the newly imitated syntax only deals with offsets and for that reason shouldn't be affected by KSH_ARRAYS, however. I'd be happy to get any other views. Should ${foo:1} always start 1 character/element beyond the first one, regardless which subscripting rules are in use? I'm now inclining in that direction. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/