From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26347 invoked from network); 10 Jun 2002 16:08:17 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 10 Jun 2002 16:08:17 -0000 Received: (qmail 24664 invoked by alias); 10 Jun 2002 16:08:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17310 Received: (qmail 24649 invoked from network); 10 Jun 2002 16:08:06 -0000 From: "Bart Schaefer" Message-Id: <1020610160735.ZM8154@candle.brasslantern.com> Date: Mon, 10 Jun 2002 16:07:34 +0000 In-Reply-To: <24097.1023710714@csr.com> Comments: In reply to Peter Stephenson "The sh substitution problem." (Jun 10, 1:05pm) References: <24097.1023710714@csr.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Peter Stephenson , zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: The sh substitution problem. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 10, 1:05pm, Peter Stephenson wrote: } Subject: The sh substitution problem. } } This is tricky and I have no idea of its detailed feasibility. If } anyone wants to try they should. Otherwise just make comments. I think the discussion Oliver and I had earlier this year, e.g. http://www.zsh.org/mla/workers/2002/msg00512.html regarding passing around Parameter structs instead of Value structs, is the key to this problem as well. If the right-hand-side of the :+ (etc.) were encoded as a parameter, it can carry around all the state necessary to properly substitute it when the time comes. Passing it around as just a string or array is not sufficient, no matter what you do WRT preserving nulls etc. You sort of hint at this when you say: } [It might be possible to keep val and aval as a pair in a structure, } a sort of pseudo-parameter, and only convert between scalar and array } when really necessary with a `forcescalar' or `forcearray' } function/macro.] Of course this is a more significant rewrite than just "fixing" multsub(), but last year I had several goes at multsub() without coming up with anything usable. -- 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