From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29999 invoked from network); 4 Jun 2007 16:57:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.0 (2007-05-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=no version=3.2.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Jun 2007 16:57:43 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 16068 invoked from network); 4 Jun 2007 16:57:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Jun 2007 16:57:37 -0000 Received: (qmail 28338 invoked by alias); 4 Jun 2007 16:57:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23520 Received: (qmail 28228 invoked from network); 4 Jun 2007 16:57:19 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Jun 2007 16:57:19 -0000 Received: (qmail 13544 invoked from network); 4 Jun 2007 16:57:19 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 4 Jun 2007 16:57:16 -0000 Received: from torch.brasslantern.com ([71.116.90.58]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JJ400IO2F2WMZZ2@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Mon, 04 Jun 2007 11:56:57 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id l54Guspe017622 for ; Mon, 04 Jun 2007 09:56:55 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id l54GusDG017621 for zsh-workers@sunsite.dk; Mon, 04 Jun 2007 09:56:54 -0700 Date: Mon, 04 Jun 2007 09:56:54 -0700 From: Bart Schaefer Subject: Re: Change in FIGNORE behavior In-reply-to: <20070604104901.276f7d83@news01.csr.com> To: "zsh workers" Message-id: <070604095654.ZM17620@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20a807210705291856qe306eeds250f4f9d5f4dd33f@mail.gmail.com> <200705300945.l4U9jUbE009607@news01.csr.com> <20070530112934.3950357b@news01.csr.com> <070530035810.ZM29792@torch.brasslantern.com> <200705301127.l4UBROR5010814@news01.csr.com> <20070530135436.410e11ff@news01.csr.com> <20070604104901.276f7d83@news01.csr.com> Comments: In reply to Peter Stephenson "Re: Change in FIGNORE behavior" (Jun 4, 10:49am) On Jun 4, 10:49am, Peter Stephenson wrote: } Subject: Re: Change in FIGNORE behavior } } > +On failure the empty string is returned for a single match; any } > +time a valid subscript is needed (for example, on an assignment } > +to a failed element, or in a subscript range) the subscript is } > +treated as the location of the first element. } } Any strong reaction to this further change for (R)? I'm tempted to put } it in in the hope it's the best of a bad job. I confess I have not yet had a chance to really even think about it. I seem to recall a previous conversation on this subject in which the former behavior (prior to 23440) was as it was so that both (R) and ${array[$array[(I)pattern]}} would return the same result. } I think the ideal case would be that a failed (R) returned an index off the } beginning of the array. That would be ideal for (I) as well, and in the absence of KSH_ARRAYS it would sort of be possible. Maybe what we need is (sigh) yet another flag that controls the behavior of index zero. Given such a flag (and possibly even without it), we could make it an error to assign to array[0] (treat it as an invalid identifier) when the KSH_ARRAYS option is not in effect. When KSH_ARRAYS *is* in effect, you already have to jump through hoops to figure out what it means for (I) to return zero, so one is really no worse off in that case.