From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12877 invoked by alias); 30 Dec 2012 20:56:00 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17510 Received: (qmail 6643 invoked from network); 30 Dec 2012 20:55:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.212.42 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=gbKrkbI4wJfRkfhB+5jef7g7/WDr94cf0ZyTWVteGxc=; b=QgJDmvvDGDrFsY8DdNuxJbkHqPv7iQNPLWN1a3Y89AebN95kWL0uzGLvUuVK4/GgUP 3ewCdsr3QyDvslWfzrOmBmMNd3ObQtecGyjyvyBsGFEgXIn0xmREiI5R+EfZj+bC84N9 2rUfcORJfZk66KmEyLCobwhJMvDuE0ssXJjBME7pO+ISqGAetCIrrFfgdUXBSsIRF+lN CDBEGPpCC2hLU4+Ooi7Jckk/kp4SY743grDjULF0EC56cuwUbY25bl3U8Dp3f3d9hKBe CLq7IRk+91lh3ORV/8h6RV4eYQiqi4uH/rBbwctKB/w5eZe3ALrn3IKiMNIxPnTnRoGI keXg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eatnumber1.com; s=google; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=gbKrkbI4wJfRkfhB+5jef7g7/WDr94cf0ZyTWVteGxc=; b=UZsyBmQHt6YPY0u65fcqjhOijdol6g47VPZee/z5zzBfEjOdoOFivoYvFQTlbK1nkY PRQu/l1natw7Mce6dd5+KmEP8zHUcpUPtv7NghOMzV0Q5VINmEFlbyPcli/MQ+I/iNIA NogwEVqdqqOYstEzFE6INCLzz7ocw0Qo0A180= MIME-Version: 1.0 Sender: eatnumber1@gmail.com In-Reply-To: <121230113526.ZM967@torch.brasslantern.com> References: <121230113526.ZM967@torch.brasslantern.com> From: Russell Harmon Date: Sun, 30 Dec 2012 15:55:20 -0500 X-Google-Sender-Auth: Bp1e5CTZfxGmHnxpB-pgMOBz-Fs Message-ID: Subject: Re: err_return inside function who's return value is checked To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 On Sun, Dec 30, 2012 at 2:35 PM, Bart Schaefer wrote: > This obviously is a case where err_return might be permitted to behave > differently without causing too much consternation, but that's not how > it has been defined. Can this be arranged? It would enable idioms like the following to be used: function get_major_version { setopt err_return [[ $(program -V) =~ "version ([[:digit:]]+)\." ]] REPLY=$match[1] } which I think is quite nice