From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26979 invoked from network); 30 Jun 2001 07:57:20 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Jun 2001 07:57:20 -0000 Received: (qmail 18985 invoked by alias); 30 Jun 2001 07:56:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15187 Received: (qmail 18965 invoked from network); 30 Jun 2001 07:56:26 -0000 From: "Bart Schaefer" Message-Id: <010630005621.ZM20243@candle.brasslantern.com> Date: Sat, 30 Jun 2001 00:56:20 -0700 In-Reply-To: Comments: In reply to Peter Stephenson "Re: named references" (Jun 28, 10:39am) References: X-Mailer: Z-Mail Lite (5.0.0 30July97) To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: named references MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 28, 10:39am, Peter Stephenson wrote: > Subject: Re: named references > > I'd be very tempted just to store the name of the object referred to, > after a bit of sanity checking, and dereference it right at the last > minute as if with ${(P)...} The problem with the "at the last minute" approach is that there are a lot more places where namerefs have to expose the underlying parameter than just in the parameter substitution code. If the dereference takes place too late, it has to be dealt with in multiple places: assignment, `unset', substitution, etc. Consider for example: typeset -n ref=var echo ${(P)ref} This should, I think, be equivalent to ${(P)var}, which means the nameref dereference has to happen at a lower level than the current substitution code. Then there's the existing problem of `${(P)1}': I'm concerned that if the dereferencing happens even as late as it did in Oliver's sample code, we're going to run into that sort of thing in a lot of other places. -- 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