From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9942 invoked from network); 14 Nov 2006 21:30:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Nov 2006 21:30:12 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 32323 invoked from network); 14 Nov 2006 21:29:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Nov 2006 21:29:58 -0000 Received: (qmail 2372 invoked by alias); 14 Nov 2006 21:29:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22999 Received: (qmail 2362 invoked from network); 14 Nov 2006 21:29:50 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 14 Nov 2006 21:29:50 -0000 Received: (qmail 31523 invoked from network); 14 Nov 2006 21:29:50 -0000 Received: from wx-out-0506.google.com (66.249.82.230) by a.mx.sunsite.dk with SMTP; 14 Nov 2006 21:29:47 -0000 Received: by wx-out-0506.google.com with SMTP id i31so1648938wxd for ; Tue, 14 Nov 2006 13:29:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=dYU5QjOKeC35saN6rcTAwKxvQpm151+gntU//B14BqaDoPqoESbbfYpzL/HMvsR+92ecXb0NoKrFDIqWsouo29EwvxTNeMBUE3+qUA6FdVXPmxXhYYUKBB7PxEFEXZtrZqn3pgnqMkSC9a2fBAN+AyxhZQHyAD1U9FFVpOhRUhg= Received: by 10.90.100.2 with SMTP id x2mr1615275agb.1163539785972; Tue, 14 Nov 2006 13:29:45 -0800 (PST) Received: by 10.90.65.18 with HTTP; Tue, 14 Nov 2006 13:29:45 -0800 (PST) Message-ID: Date: Tue, 14 Nov 2006 22:29:45 +0100 From: "Nikolai Weibull" Sender: nikolai.weibull@gmail.com To: "Zsh hackers list" Subject: Advantages of using _argument states MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 527d92df138716b0 What are the advantages and disadvantages of using _argument states over writing functions that generate the matches, i.e, '*-chmod[change mode of file]:mode:->modes' versus '*-chmod[change mode of file]:mode:_modes' (or perhaps __modes to not clutter the Type-completion namespace)? As far as I can tell, the only difference (and an obvious one at that) is that states result in a big case-statement but you avoid extra functions, whereas writing a function adds an extra function, but saves us from the big case-statement. I've gone over the documentation a bunch of times and I've been looking through completion definitions without seeing any point to using states over functions. Am I correct in my assessment that they're basically two ways of doing the same thing and the difference between them is the one I wrote about above? Also, writing a function makes it easier to turn that into a Type completion later on, if need be. (By the way, I'm writing a completion definition for mkisofs and growisofs.) Thanks! nikolai