From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20587 invoked from network); 19 Jun 2008 16:11:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Jun 2008 16:11:12 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 12357 invoked from network); 19 Jun 2008 16:11:08 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Jun 2008 16:11:08 -0000 Received: (qmail 1686 invoked by alias); 19 Jun 2008 16:11:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25218 Received: (qmail 1670 invoked from network); 19 Jun 2008 16:11:04 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 19 Jun 2008 16:11:04 -0000 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.226]) by bifrost.dotsrc.org (Postfix) with ESMTP id 59EAF8084FA0 for ; Thu, 19 Jun 2008 18:10:57 +0200 (CEST) Received: by rv-out-0506.google.com with SMTP id g37so6240868rvb.21 for ; Thu, 19 Jun 2008 09:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=8kToD8ZV6Y1cJR8qd3uFe9F8uPUO7gSsVArb5cNWHAQ=; b=TOBpAuXNkwHcI8v5VTTqOsqJ1m8AAB9M8vha87thtCdafKZAVgfRRovMLiAWeJrmFX C9HRvo3znI7hoiXdL53xGQLnsMCI3aklAqYLNoz2rcNe7Vw5b7nmJKjVcEXlah9dA6a0 vC0lQNNs8ON2DDDhFY8Wgn6rPu2vZtrRTFaFE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=SdaSPNzCoSkLnuFTi861zHCecfPsnAo/i0REcp/Dz46wWot7KAX9PZ0TGkKrM0Voj7 OkkMJxqX7wMbMKb6vOx+GTgLgPR3YntgwPpb4ErslrixXfgSHH09mjrOBpLCkA4YfWN7 zLgy9iKOZbgp0eCeNCd0spDIQGTOT5HbELALk= Received: by 10.141.176.13 with SMTP id d13mr6650373rvp.196.1213891856969; Thu, 19 Jun 2008 09:10:56 -0700 (PDT) Received: by 10.141.153.6 with HTTP; Thu, 19 Jun 2008 09:10:56 -0700 (PDT) Message-ID: <237967ef0806190910q70c0d0d7y2466938b547a8ee4@mail.gmail.com> Date: Thu, 19 Jun 2008 18:10:56 +0200 From: "Mikael Magnusson" To: zsh-workers@sunsite.dk Subject: Re: arithmetic operator precedence In-Reply-To: <20080619160433.GL10734@prunille.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2d460de70806170219k12ff4cadn441b52c48bf8076f@mail.gmail.com> <2d460de70806170324o5a44609x9383cc2445d67dd6@mail.gmail.com> <20080617103829.GD5016@sc.homeunix.net> <20080617114340.398c731f@news01> <20080617112815.GF10734@prunille.vinc17.org> <200806171146.m5HBkhfR013230@news01.csr.com> <200806190958.m5J9w7BJ006695@news01.csr.com> <2d460de70806190529p1255b8b5mfe2fb2c1e1d7ba35@mail.gmail.com> <20080619160433.GL10734@prunille.vinc17.org> X-Virus-Scanned: ClamAV 0.92.1/7506/Thu Jun 19 16:51:14 2008 on bifrost X-Virus-Status: Clean 2008/6/19 Vincent Lefevre : > On 2008-06-19 14:29:03 +0200, Richard Hartmann wrote: >> On Thu, Jun 19, 2008 at 11:58, Peter Stephenson wrote: >> > That seems a good idea in any case. >> >> Can you add that this is done to remain both backwards and shell- >> compatible and that this is not what a 'real' language/calculator >> will do? > > This isn't shell-compatible. AFAIK, only bash and ksh93 support **. > >> Perhaps even include a reference to the POSIX argument. > > There's no POSIX argument. ** is just an extension. I've followed this discussion, and I'm left wondering only one thing. If it's decided that $(( -1 ** 2 )) == 1, then what's the point? Why would anyone ever write that? Why require everyone to write -(1**2) when the expression makes no sense at all without the parentheses? Ie you would just write 1**2 without the - at all, nobody would ever write (-1)**2. -- Mikael Magnusson