From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13505 invoked by alias); 3 Jun 2010 13:23:28 -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: 27993 Received: (qmail 8768 invoked from network); 3 Jun 2010 13:23:13 -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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.121.35 as permitted sender) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1275571385; bh=02RGP44P/yiRigYMMT6rV1TN/Ho=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=DxCiM5imeUI6tIZZfW9hzSk/CF1KmzSW6EtguRZBceW9opGqStpQuPgQ1Z9w/0/90 dS5gsA3wR2oP6jNjW4Ddw== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=p+UsnRwcaQJCa/mtgcBvIHCLjmVWzUuLGJEgc2u0ZMn94W0ZiT2ComcFe5Q1QvxZW /TQWMNMuwDswpibp+Hd8Q== MIME-Version: 1.0 In-Reply-To: <20100603100109.1b090b4e@csr.com> References: <201006012145.o51LjhGg005724@pws-pc.ntlworld.com> <20100602121901.6ce71329@csr.com> <20100603100109.1b090b4e@csr.com> Date: Thu, 3 Jun 2010 06:22:57 -0700 Message-ID: Subject: Re: zsh ignores the arguments on its first command. From: Martin Buchholz To: Peter Stephenson Cc: zsh-workers@zsh.org, Joel Ebel Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true On Thu, Jun 3, 2010 at 02:01, Peter Stephenson w= rote: > 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. =A0You're basically asking for all (or a > substantial subset of) autoload failures to be silent. I think you're right that users should be notified of all module load failures, including those caused by autoloaded features. However, "unknown parameter" is a very misleading and frustrating error message, especially when the construct ${+NAME} asks to simply return 0 for unknown parameters. Emacs has a similar feature, and a more informative error message, of the form error ("Autoloading failed to define function %s", So please change the zsh error to something like "Autoloading of module %s failed to define parameter %s" Martin > To me, the module autoload is a contract that when you reference the > variable the module *will* be loaded. =A0If it isn't that's an error. =A0= Take > the present example: the module failed to load because of an error that (= so > far as I know) we're not interested in. =A0If this instead failed silentl= y > 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 modul= es > 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). =A0If you're paranoid about not having module loads fail you need to= do > more at the zmodload level. > > -- > Peter Stephenson =A0 =A0 =A0 =A0 =A0 =A0Software Engineer > Tel: +44 (0)1223 692070 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Cambridge Sil= icon 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 a= nd Wales, registered number 4187346, registered office Churchill House, Cam= bridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom >