From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20565 invoked by alias); 19 Oct 2015 18:35:23 -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: 20794 Received: (qmail 5233 invoked from network); 19 Oct 2015 18:35:23 -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=Tys+94ODMNw8C+OpPwgqY8sM4PAPJNNEVrM4RwOEcuM=; b=Xo175fZOcd194BoGVsJLWSynukaBgUv1iTxFCu2mwDfB4Zo/sjjoXKr+hmf1gETbGz yHsCNqakAt0BnAnZr+1q3AcXFF7FQPkxJ9vyHwNLtsiorNsF3X5cpfw76zD+9lPbGq2j s9EWU7XehaGXO9E+tNxD+FyyA2QbIBnoF/Uxw7wUESn3qW1IkLK2hxu+iF9wY3y0GCu0 i3UQQaTqtHL51TAav2dL8R2MS6sLpg6wbNvFr+mu84FFliemixMDcZVl1fXviizH5RLZ nlFFXIsmUxWTnt/yM47zpsksjBWT76VA3lAIT0g7IBaHld/c86oy3rloxDzX9GVsnnWb aJhg== X-Gm-Message-State: ALoCoQmeTKNJKQET2zC732OQfhpQiyo1WRTVXTcyYhw5qCIQpKotm8zsx1c95QEmmNofyA9LdYHS X-Received: by 10.202.65.11 with SMTP id o11mr10127927oia.18.1445279720282; Mon, 19 Oct 2015 11:35:20 -0700 (PDT) From: Bart Schaefer Message-Id: <151019113517.ZM32739@torch.brasslantern.com> Date: Mon, 19 Oct 2015 11:35:17 -0700 In-Reply-To: <562483C9.1060602@eastlink.ca> Comments: In reply to Ray Andrews "suprise with -=" (Oct 18, 10:46pm) References: <562483C9.1060602@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: suprise with -= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 18, 10:46pm, Ray Andrews wrote: } } That's a bit of a surprise, why is zsh fussier with '-=' than with '+='? Outside of the (( )), -= is not an assignment operator at all, because the default is to do either array or string assignment, and there is no sensible way to "subtract" one array or string from another. Conversely += is defined to mean "append", so it is a valid operator. I'd almost call it a bug that [outside of (( )) context] first+=second does arithmetic when $first is an integer. It ought to be either an error or forcibly convert $first to string and append "second".