zsh-users
 help / color / mirror / code / Atom feed
From: Eric Cook <llua@gmx.com>
To: zsh-users@zsh.org
Subject: Re: Could someone clarify how math functions work?
Date: Fri, 19 Dec 2014 06:15:14 -0500	[thread overview]
Message-ID: <549408C2.6030207@gmx.com> (raw)
In-Reply-To: <141218213450.ZM28822@torch.brasslantern.com>

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


  parent reply	other threads:[~2014-12-19 11:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19  3:45 Eric Cook
2014-12-19  5:16 ` Kurtis Rader
2014-12-19  5:34 ` Bart Schaefer
2014-12-19  5:48   ` Kurtis Rader
2014-12-19  5:51     ` Kurtis Rader
2014-12-19  6:05     ` Bart Schaefer
2014-12-19 11:15   ` Eric Cook [this message]
2014-12-19  9:35 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=549408C2.6030207@gmx.com \
    --to=llua@gmx.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).