From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1640 invoked from network); 25 Feb 1999 11:15:55 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Feb 1999 11:15:55 -0000 Received: (qmail 5695 invoked by alias); 25 Feb 1999 11:15:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5522 Received: (qmail 22399 invoked from network); 25 Feb 1999 10:29:46 -0000 Date: Thu, 25 Feb 1999 11:28:51 +0100 (MET) Message-Id: <199902251028.LAA29359@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Wed, 24 Feb 1999 10:29:36 +0100 (MET) Subject: Re: completion test suggestion I wrote: > To make this more friendly to the eye, we could also keep the > condition codes and make them non-modifying: > > if [[ -between s1 s2 ]]; then > words=("${(@)words[rangebeg(s1,s2),rangeend(s1,s2)]}") > > and so on. After thinking more about this: for this example the test `(( -rangebeg(s1,s2) ))' should already be enough. For other tests we could just add some helpful functions, e.g. `prefix(s1,s2)' which returns the length of the common prefix of both strings and so on. Such functions may be helpful in writing shell functions that do matching anyway and with a good set of such functions we could put all tests together in one `(( ... ))'. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de