From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 860 invoked by alias); 21 Oct 2015 18:47: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: 20803 Received: (qmail 26965 invoked from network); 21 Oct 2015 18:46:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=KvnSHsAbgg827Gwafla1szI6dLjSxc+ARzmxefOSDdw=; b=VSMiBVUYuMKQFy9mMTp5JgWaTGpySyvOZCTskW8LP2xljOeZUx0bg3WkCeKhn40Zqa M7QcBhvvJp19Je6NmF33J32g5nFg4xmQcdZ50LLxJpAzP3D1bGE5MeyVMkgrnz37TbuC YfcR7mFV7Dr7+6qAtcnfdV6TFGt8KebDEFU8ruM9yIi0GOBnbAC+jm90P19ubqeu+S6u nl2aHBSiCtTd2SiPbihzHvUfJvQo/9vc75QnmtWkeyaAT2bGmmlSA6Wwj13dw4vKC99p p1hu6+k44uJsbLT5Lmkm+4PSzVxuq81YD3lPox9ycIO4C1bgDJal458XErQLCdiFV8eW Zhog== X-Gm-Message-State: ALoCoQnpMUQs1MhQOY6i1J/lwfSoJe4+RZbS8CEPaF/uVbh/BSFYd2zCkhvyJtJjqd7bn7l0yzZ4 X-Received: by 10.202.220.212 with SMTP id t203mr7080434oig.73.1445453215701; Wed, 21 Oct 2015 11:46:55 -0700 (PDT) From: Bart Schaefer Message-Id: <151021114653.ZM2741@torch.brasslantern.com> Date: Wed, 21 Oct 2015 11:46:53 -0700 In-Reply-To: <5627D2F8.3000004@eastlink.ca> Comments: In reply to Ray Andrews "Re: suprise with -=" (Oct 21, 11:01am) References: <562483C9.1060602@eastlink.ca> <151019113517.ZM32739@torch.brasslantern.com> <562545DD.5020008@eastlink.ca> <151019172744.ZM558@torch.brasslantern.com> <5627D2F8.3000004@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: suprise with -= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 21, 11:01am, Ray Andrews wrote: } Subject: Re: suprise with -= } } On 10/19/2015 05:27 PM, Bart Schaefer wrote: } > The parser doesn't know that "first" is an integer, or even that it's } > a variable that was previously declared. } That puzzles me. Have not all your examples demonstrated that the } parser is aware of the type of the variable and that it will perform } it's operations accordingly? No. Parser is syntax, not semantics. It knows "x=y" has a valid shape, and to create code to invoke an assignment at run time, but not what the assignment will do with x or y when run. You can think of "third=first+second" as syntactic sugar for the command "typeset third=first+second" -- it's the command that knows the type of the variable, not the parser.