From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10325 invoked by alias); 21 Nov 2010 06:34:20 -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: 28426 Received: (qmail 10668 invoked from network); 21 Nov 2010 06:34:07 -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: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <101120223401.ZM6950@torch.brasslantern.com> Date: Sat, 20 Nov 2010 22:34:01 -0800 In-reply-to: <20101120211528.0caf8697@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: PATCH: bash-style substrings & subarrays" (Nov 20, 9:15pm) References: <27165.1290012857@csr.com> <101119100147.ZM4622@torch.brasslantern.com> <20101120211528.0caf8697@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org (Zsh hackers list) Subject: Re: PATCH: bash-style substrings & subarrays MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Nov 20, 9:15pm, Peter Stephenson wrote: } Subject: Re: PATCH: bash-style substrings & subarrays } } On Fri, 19 Nov 2010 10:01:45 -0800 } Bart Schaefer wrote: } > On Nov 17, 4:54pm, Peter Stephenson wrote: } > } } > } This implements the ${NAME:OFFSET} and ${NAME:OFFSET:LENGTH} syntax. } > } > I'm wondering whether :OFFSET:LENGTH shouldn't always use KSH_ARRAYS } > semantics, or be a valid syntax only when KSH_ARRAYS is set? } } I can see that if you interpret the word "OFFSET" literally it's } different from a subscript and you might interpret it as starting } from 0 in any case. I still think on balance consistency with normal } subscripting is preferable. I agree that consistency wth normal subscripting is preferable, but subscripting behaves like a pair of offsets only when KSH_ARRAYS is set (hence the second alternative I suggested). However, I'm mostly indifferent. } 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 ...? Thanks for the additional patch.