From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1086 invoked from network); 22 Jan 1999 17:18:27 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 22 Jan 1999 17:18:27 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id MAA27254; Fri, 22 Jan 1999 12:10:47 -0500 (EST) Resent-Date: Fri, 22 Jan 1999 12:10:47 -0500 (EST) From: "Bart Schaefer" Message-Id: <990122090949.ZM26472@candle.brasslantern.com> Date: Fri, 22 Jan 1999 09:09:49 -0800 In-Reply-To: <19990122161858.B26327@fysh.org> Comments: In reply to Phil Pennock "Re: experimental new style completion" (Jan 22, 4:18pm) References: <199901221450.PAA28628@beta.informatik.hu-berlin.de> <19990122161858.B26327@fysh.org> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Phil Pennock , zsh-workers@math.gatech.edu Subject: Re: experimental new style completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"kcO8c2.0.kf6.N4Bgs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4954 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jan 22, 4:18pm, Phil Pennock wrote: } Subject: Re: experimental new style completion } } Whilst it's nice and understandable to people who're extensively } familiar, doesn't anyone else think it's time to sit back and try and } look at this syntax objectively? It surely is gory, but there's only so much that can be done to clarify it, particularly with the constraint that it can't conflict with any syntax used by either the Bourne or Korn shells. However, it's not as bad as you imply; there are stylistic issues. eval b\=\( \$\{b:/\*\(${(j:|:)fignore}\)\} \) I wouldn't have used all those backslashes ... I prefer quotes: eval 'b=( ${b:/*('${(j:|:)fignore}')} )' which leaves just two oddities: The (|) glob alternation syntax and the admittedly icky parameter flags syntax. It becomes slightly more readable if you replace the `:' with matching parens or braces: eval 'b=( ${b:/*('${(j(|))fignore}')} )' Would it help to have written it this way? fignore_alternatives="${(j(|))fignore}" fignore_glob="*($fignore_alternatives)" eval 'b=( ${b:/'$fignore_glob'} )' The final nasty bit here is the need to "eval" to strip the quoting from the `|' characters in the alternatives, so that the glob will work right. For those still confused, the whole mess is the same as: b_=() for i in "$b[@]" do for j in "$fignore[@]" do case "$i" in *${j}) continue 2 ;; esac done b_=("$b_[@]" "$i") done b=("$b_[@]") -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com