From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2920 invoked by alias); 19 Dec 2014 11:15:33 -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: 19609 Received: (qmail 8965 invoked from network); 19 Dec 2014 11:15:22 -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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Message-ID: <549408C2.6030207@gmx.com> Date: Fri, 19 Dec 2014 06:15:14 -0500 From: Eric Cook User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: Could someone clarify how math functions work? References: <54939F50.50102@gmx.com> <141218213450.ZM28822@torch.brasslantern.com> In-Reply-To: <141218213450.ZM28822@torch.brasslantern.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:M1RvsNJUiBDlNQJ7u/m/APMzIHOvIm9pnz7YYxO4KYzRfW7F0Rc FSjN4N8NE7WSbXYYgLSODGHdzDFc/M/LMu+iuYyYE1TVrPgMM9pQ8R/XkkU5/dxCcuYkW7y zpqvNo3xbAxEpLYi/yWj7m9cIQ120cNzcwtcvbldeWNT2Vcpxx6acnxb05++EJXl1nbtweo rh7D/wBEoY5oMPq40fVsA== X-UI-Out-Filterresults: notjunk:1; On 12/19/2014 12:34 AM, Bart Schaefer wrote: > > When you define add() with parens ( ) around the function body, you > are running the function body in a subshell. The "last arithmetical > expression evaluated" IN THE CURRENT SHELL is the processing of the > argument list of the call to add(), which is done left-to-right and > is therefore "3" in the original example. Ah, It was indeed obvious to me that it was due to the subshell function definition. but i wasn't aware of processing the positional parameters being an arithmetic evaluation, which left me lost as to why the last argument was the returned value. Thank you