From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5580 invoked from network); 3 Mar 1999 06:40:00 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Mar 1999 06:40:00 -0000 Received: (qmail 29270 invoked by alias); 3 Mar 1999 06:39:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5611 Received: (qmail 29263 invoked from network); 3 Mar 1999 06:39:48 -0000 From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: Recursive completion (was: RE: Reading completion manual) Date: Wed, 3 Mar 1999 09:39:13 +0300 Message-ID: <000201be6540$8d5eb8a0$21c9ca95@mowp.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2013.2901 Importance: Normal May be, this solves the original problem? > > As most of us, I don't like the idea of conditions with side > effects. But I don't like the Sven's suggestion of replacing > conditions with shell code either (at least, with *THIS* code :-) > Even more, as it does not solve the original problem - you still > have to save parameters and restore them after that. I'd suggest > something in between - conditions set special parameters > (elements of hash?) that can be used to extract matched > substrings/words. That is almost the same, as Sven's suggestion, > but probably more user-friendly :) something like > > if [[ -between string1 string2 ]]; then > local -a nwords > nwords=(words[$FIRST,$LAST]) > ... > > if [[ -between string1 string2 ]]; then compalso --from=first --to=last compalso() { for i in $* case $i in --from=* ) from=${i#--from=} ;; .... words=($words[$from,$to]) ... } I bet, this can be written as one line :-) cheers /andrej