From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23614 invoked by alias); 3 Jun 2010 09:01:46 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27992 Received: (qmail 27411 invoked from network); 3 Jun 2010 09:01:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Thu, 3 Jun 2010 10:01:09 +0100 From: Peter Stephenson To: Martin Buchholz , zsh-workers@zsh.org Cc: Joel Ebel Subject: Re: zsh ignores the arguments on its first command. Message-ID: <20100603100109.1b090b4e@csr.com> In-Reply-To: References: <201006012145.o51LjhGg005724@pws-pc.ntlworld.com> <20100602121901.6ce71329@csr.com> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.9; i686-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Jun 2010 09:01:10.0183 (UTC) FILETIME=[4F5E7B70:01CB02FB] X-Scanned-By: MailControl A_09_40_00 (www.mailcontrol.com) on 10.71.1.121 On Wed, 2 Jun 2010 09:44:13 -0700 Martin Buchholz wrote: > I was thinking that, in addition, > the construct ${+NAME} > should never cause "unknown parameter", > not even due to failure to load a module > that provides the parameter as a feature, > so an additional fix in the zsh core might be good. > If a module fails to load, NAME should become an > ordinary unset variable, and ${+NAME} should be 0. I don't think that can be right. You're basically asking for all (or a substantial subset of) autoload failures to be silent. To me, the module autoload is a contract that when you reference the variable the module *will* be loaded. If it isn't that's an error. Take the present example: the module failed to load because of an error that (so far as I know) we're not interested in. If this instead failed silently the user would simply know that $terminfo wasn't working despite the fact they've (maybe implicitly) asked for it and not have a clue why or even that something had failed and hence wouldn't know what to do about it. The autoload interface is a convenience to avoid you having to load modules explicitly, which deliberately doesn't expose the module layer directly, so necessarily interacts with it simply (load the module on demand, and that's it). If you're paranoid about not having module loads fail you need to do more at the zmodload level. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom