From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2125 invoked from network); 15 Jun 2004 10:33:07 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 15 Jun 2004 10:33:07 -0000 Received: (qmail 2086 invoked from network); 15 Jun 2004 10:32:54 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Jun 2004 10:32:54 -0000 Received: (qmail 19980 invoked by alias); 15 Jun 2004 10:32:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20051 Received: (qmail 19970 invoked from network); 15 Jun 2004 10:32:50 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 15 Jun 2004 10:32:47 -0000 Received: (qmail 1899 invoked from network); 15 Jun 2004 10:32:47 -0000 Received: from mail36.messagelabs.com (193.109.254.211) by a.mx.sunsite.dk with SMTP; 15 Jun 2004 10:32:45 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-9.tower-36.messagelabs.com!1087295525!6973638 X-StarScan-Version: 5.2.10; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 25718 invoked from network); 15 Jun 2004 10:32:05 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-9.tower-36.messagelabs.com with SMTP; 15 Jun 2004 10:32:05 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i5FAW5UI027280 for ; Tue, 15 Jun 2004 11:32:05 +0100 Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id E71077970C6A for ; Tue, 15 Jun 2004 12:31:20 +0200 (CEST) X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: From: Oliver Kiddle References: To: Zsh hackers list Subject: Re: PATCH: `try' syntax Date: Tue, 15 Jun 2004 12:31:20 +0200 Message-ID: <6755.1087295480@trentino.logica.co.uk> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=BAYES_50 autolearn=no version=2.63 X-Spam-Hits: 0.0 Bart wrote: > * A "shortloops" form "try { ... }" might be nice, or maybe should be the > only form. Or, thinking along those lines, you could use something like { ... } always { ... } That currently finds a syntax error at always. > * Rather than putting colons or some other unlikely character in front of > the name, use plain words and start with them "disable"d, so that in order > to use this syntax one must first "enable -r try always tried". (This > technique could apply to other extension syntax as well.) That would be quite a good way of handling it. My main reservation concerns the fact that it isn't possible to make the enabled/disabled state of builtins local. Consider _approximate. It'd be nice to use a try/always block to do the job currently performed by a trap to unfunction compadd. So how do you enable try and always but restore their original state when completion exits. It's possible using the parameters module but would get fairly messy. And we'd be wanting to re-disable `tried' from within an always block. Oliver