From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8758 invoked from network); 14 Nov 2003 17:14:40 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 14 Nov 2003 17:14:40 -0000 Received: (qmail 19291 invoked by alias); 14 Nov 2003 17:14:20 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6775 Received: (qmail 19230 invoked from network); 14 Nov 2003 17:14:19 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 14 Nov 2003 17:14:19 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.64.232.71] by sunsite.dk (MessageWall 1.0.8) with SMTP; 14 Nov 2003 17:14:19 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id hAEHEHq02440 for zsh-users@sunsite.dk; Fri, 14 Nov 2003 09:14:17 -0800 From: Bart Schaefer Message-Id: <1031114171417.ZM2439@candle.brasslantern.com> Date: Fri, 14 Nov 2003 17:14:17 +0000 In-Reply-To: <19332.1068826982@csr.com> Comments: In reply to Peter Stephenson "Re: Completion function for bitkeeper?" (Nov 14, 4:23pm) References: <19332.1068826982@csr.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.dk Subject: Re: Completion function for bitkeeper? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii [This should move to zsh-workers?] On Nov 14, 4:23pm, Peter Stephenson wrote: } Subject: Re: Completion function for bitkeeper? } } Bart Schaefer wrote: } > Word splitting is vastly different in the two cases. It happens within } > the words of $action in the second case, but does not in the first case. That's a bit incoherent, let me try again. Consider what happens when there are command separators in the values of $action. Suppose e.g. that action=( \{ foo '&&' bar \} ) } while _next_label "$subc" expl "$descr"; do } eval "$action[2,-2]" && ret=0 } done In the above case we execute the equivalent of foo && bar && ret=0 However, if instead action=( ' ' foo '&&' bar ) } eval "action=( $action )" } while _next_label "$subc" expl "$descr"; do } "$action[@]" && ret=0 } done In this second case it's a syntax error. I suppose it could be argued that the second case is unnecessary because it's only a shorthand for the first case with only one command in the braces. Also in the second case the eval has been factored out of the loop because we're always interested in the entire value of "$action" and it's fractionally more efficient to do the "eval" once only. However, on third thought, it could be argued that the second case has a bug. Consider action=( " foo ) && bar=( oops" )