From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8000 invoked from network); 6 Mar 2006 16:24:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Mar 2006 16:24:58 -0000 Received: (qmail 19791 invoked from network); 6 Mar 2006 16:24:52 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Mar 2006 16:24:52 -0000 Received: (qmail 1669 invoked by alias); 6 Mar 2006 16:24:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22329 Received: (qmail 1660 invoked from network); 6 Mar 2006 16:24:49 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Mar 2006 16:24:49 -0000 Received: (qmail 19506 invoked from network); 6 Mar 2006 16:24:49 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 6 Mar 2006 16:24:48 -0000 Received: from torch.brasslantern.com ([71.116.81.225]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IVP00GL7S9A4ZUD@vms044.mailsrvcs.net> for zsh-workers@sunsite.dk; Mon, 06 Mar 2006 10:24:47 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id k26GPuj5004129 for ; Mon, 06 Mar 2006 08:26:05 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id k26GPtCh004128 for zsh-workers@sunsite.dk; Mon, 06 Mar 2006 08:25:55 -0800 Date: Mon, 06 Mar 2006 08:25:53 -0800 From: Bart Schaefer Subject: Re: [PATCH][RFC] check for heap memory in zfree() In-reply-to: To: zsh-workers@sunsite.dk (Zsh hackers list) Message-id: <060306082555.ZM4127@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <200603051723.k25HNdZI003407@pwslaptop.csr.com> <060305124316.ZM25210@torch.brasslantern.com> Comments: In reply to Peter Stephenson "Re: [PATCH][RFC] check for heap memory in zfree()" (Mar 6, 10:32am) On Mar 6, 10:32am, Peter Stephenson wrote: } } Bart Schaefer wrote: } > IMO a unique array is a distinct type from an ordinary array. } } I'm not convinced about that. I think it's just a tidying up operation } performed on the value. If it only happened on output, like -LRZ, I'd agree with you. But then it would be worse than useless for dirstack. } > For example, although you can (without getting warnings) set the -LRZ } > options on any array, they don't have any effect except to make the } > array show up in "typeset -LRZ" output. } } That's a bug, probably, although it might need care fixing (does the } flag apply if the array is about to be joined?) I'd be tempted to say they apply when joining with $arr[@] but not with $arr[*], but -Z gives me pause. I guess I think -LR should work like ${(l:N:)...} and ${(r:N:)...}, which is where the [@] [*] distinction comes from. I wish (l) were for lower-case and (r) for match-rest so we could have (L:N:) (R:N:) and add (Z:N:), but it's years too late now. } It doesn't make sense to have dirstack an integer, but it does makes } sense to have it contain unique elements. That could be made to "work" for dirstack by adopting something like Andrey's 22320, where the set-fn is not called until after the new flags are in place. dirssetfn() could then check for PM_UNIQUE and frob PUSHD_IGNORE_DUPS to match. I think that would be even more broken, though. The number of possible bad interactions doubles -- people would be confused about why their change to setopt reverts whenever they assign to dirstack, etc. --