From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6947 invoked from network); 16 Jun 2004 17:22:25 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 16 Jun 2004 17:22:25 -0000 Received: (qmail 28991 invoked from network); 16 Jun 2004 17:22:14 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Jun 2004 17:22:14 -0000 Received: (qmail 2756 invoked by alias); 16 Jun 2004 17:22:06 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20061 Received: (qmail 2746 invoked from network); 16 Jun 2004 17:22:04 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 16 Jun 2004 17:22:01 -0000 Received: (qmail 28711 invoked from network); 16 Jun 2004 17:22:01 -0000 Received: from moonbase.zanshin.com (root@64.84.47.139) by a.mx.sunsite.dk with SMTP; 16 Jun 2004 17:21:59 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i5GHLv9H014247 for ; Wed, 16 Jun 2004 10:21:57 -0700 Date: Wed, 16 Jun 2004 10:21:57 -0700 (PDT) From: Bart Schaefer Sender: schaefer@toltec.zanshin.com Reply-To: Zsh hackers list To: Zsh hackers list Subject: Re: PATCH: `try' syntax In-Reply-To: <15239.1087396405@trentino.logica.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Wed, 16 Jun 2004, Oliver Kiddle wrote: > Bart wrote: > > > local -a +h reswords dis_reswords > > > > either the values aren't restored and/or assigning to these arrays > > doesn't accomplish enable/disable. > > It's not odd if you look briefly at how everything in the parameters > module is implemented. When a value is looked up it gets the > information from the internal structure and returns it. Making local > save and restore these internal structures would be fairly messy. I'm pretty sure it works for _some_ variables; $functions in particular. schaefer<501> x() { > local -A +h functions > print $#functions > unfunction x > print $#functions > } schaefer<502> x 502 501 schaefer<503> print $#functions 502 schaefer<504> x 502 501 Yep, works for $functions. Maybe it's because $reswords is not a hash. (Why did we go with two arrays rather than a hash with resword keys and enabled/disabled values? I've forgotten.)