From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26974 invoked from network); 16 Dec 2007 21:03:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 Dec 2007 21:03:26 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 72920 invoked from network); 16 Dec 2007 21:03:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Dec 2007 21:03:16 -0000 Received: (qmail 14841 invoked by alias); 16 Dec 2007 21:03:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24269 Received: (qmail 14822 invoked from network); 16 Dec 2007 21:03:10 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 16 Dec 2007 21:03:10 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id 1D45C8058F54 for ; Sun, 16 Dec 2007 22:00:10 +0100 (CET) Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Sun, 16 Dec 2007 22:00:10 +0100 (CET) Received: from torch.brasslantern.com ([71.121.18.67]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JT500E5TUGWJX06@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 16 Dec 2007 15:02:57 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id lBGL2s4U002528 for ; Sun, 16 Dec 2007 13:02:55 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id lBGL2sYX002527 for zsh-workers@sunsite.dk; Sun, 16 Dec 2007 13:02:54 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id lBGL2EQh002521 for zsh-worker; Sun, 16 Dec 2007 13:02:14 -0800 Date: Sun, 16 Dec 2007 13:02:54 -0800 From: Bart Schaefer Subject: Misc. substitution things To: zsh-workers@sunsite.dk Message-id: <071216130254.ZM2526@torch.brasslantern.com> MIME-version: 1.0 MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV using ClamSMTP This seems like a bug: zsh% print $(( x + "45" )) dquote> It appears that (( and the first double-quote are taken as a matching pair of quotes. This is a recently-introduced bug, though I don't know precisely when; 4.2.6 gives: schaefer[501] print $(( x + "45" )) zsh: bad math expression: operand expected at `"45" ' Less importantly, even after 24264 (of which I conceptually approve) there is some ambiguity with the (P) flag and subscripting. torch% a=A torch% b=B torch% c=C torch% typeset -R5 x=abc torch% print $x[3] a torch% print ${(P)x[3]} C Of course it has never really been "safe" to mix (P) and a subscript without using a nested substitution to make your meaning clear (most often one of ${${(@P)x}[3]} or ${(P)${x[3]}}, rarely ${${(P)x}[3]}, because quoting changes the results of that last one). Post-24264, we're consistent with older zsh on ${(P)x[3]} but not on ${(P)${x[3]}}. This might be OK because ${(P)${x[3]}} in the above example is meaningless in older zsh (because there cannot be a parameter named " c").