From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2238 invoked from network); 28 Jun 2001 08:32:55 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Jun 2001 08:32:55 -0000 Received: (qmail 4735 invoked by alias); 28 Jun 2001 08:32:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15154 Received: (qmail 4703 invoked from network); 28 Jun 2001 08:32:03 -0000 From: "Bart Schaefer" Message-Id: <1010628083034.ZM6998@candle.brasslantern.com> Date: Thu, 28 Jun 2001 08:30:34 +0000 In-Reply-To: <000501c0ffa9$68c68350$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "RE: named references" (Jun 28, 12:07pm) References: <000501c0ffa9$68c68350$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Andrej Borsenkow" , Subject: Re: named references MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 28, 12:07pm, Andrej Borsenkow wrote: } Subject: RE: named references } } This does not touch everything (I need some time to swallow the rest :-) } } What happens in this case: } } foo() { } typeset -n r=v } local v=foo } echo $r } } } } v=bar } foo } } I.e. does r refer to outer v ("by address" could you say) or to inner } v ("by name" would it be then)? The latter would be badly broken; but } to implement the former you must have reference to pm not the name. You actually don't need the reference, you just need both the name and the local-level. Oliver's partial implementation got this right, by stashing the target local-level in the reference's `ct' field, and then after looking up the parameter by name, searching its `old' linked list for the right `level'. But using a pointer directly to the pm is a lot faster. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net