From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id C53D221164 for ; Thu, 21 Mar 2024 13:25:28 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1711023928; b=Por4p+gcoKymf3vhf9HaomdoUJPiF3PftjVfxhD0vBc1QPOVSNrXMGCiAgzAsHwJMbwS1IvcxP 7fCpCSJe7aO5EEiMEXMzOv73Z1NlFs0kLUxgBAT7VI70FnmtA2Cy0F9xT+s4/41WrvoFeAlhSl GcRdSveXPeQnzagcc2BAK/WvpqpbNYUQ+09T23N32bOgxEb7THgHcdd3kybtsXK0EfO6y4scHD rtVNDSjblYm6AVHwCzZNqiylxYl+gGIaxGsfkzjx9S5N21u3qFxwmzNXMMrPrUQ/0i0T4j03Gg NkYJlVfQpAOnCdx/doPUnPMo0hnHLG1t55KEx6B2DTZ2LQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (csmtpq4-prd-nl1-vmo.edge.unified.services) smtp.remote-ip=84.116.50.41; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1711023928; bh=YWpgYhFedOhIswcZYIyq3QkMtb0Yp9McuofS5AZca34=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=FQTeroNudETJJh4MmMD4EEYOvJMk3bZvuKYxTtmvzvMELfI7dguM7RH2YJBjNbOASbX1r0EmLi r1XkzhR1sW2wBN46AYmYwVfHZp5duYFN5j9wIZ8ll9KW9VG7cxSOQpfFoXEGUrX7TOAgo8yNz8 ZJqlC7Mv76mf3JAgCB6ZydItUF0uANoFRaP3pd2ewKrHvcmFvfsfBpoD1VyIjBOJrO/UCqjbMO BJY4g764svr8SIZPME7hz0Y2t+hoevQNnxmL7sI1Wu9tFvVtZnptW0hxUgw2EKRdVfOahhjf1x +QlNWDaGe8zOaCPd50Yy2kUBesaqs+PgHayZAotwdha80Q==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=gARjsnSUzB7XO2rOgcQyKFE5vgSXS88tJcy7aZBMieA=; b=q4DnMkTVfh3ujnRVFU3NrZ0jSU 8tgIy8erv5gNpdjnjjdnQOhcYH15qeXapHXQsg1rWxmn664CQZizsfVJ6i3Qy2ZQkzc1bywOhkO7B +ZqBHC+8uLTl4VpKx+cFjH/E07fyU5KRLYwHS4UUoN2F5LEz2Xj7EyBOFkLKFgMIQ/D6Z0fOwQv3w oiEbpq+7h8ThQzbq4elV+1WhrpxDElgvOyuqIoAxglD5REKq6mWoEs+kShX7/nmBXXO1tZOnaO1ow vugqys7RFtwn6Y7YfuO08z7NtC1r2SkD9Y5yLOoZcfHw6T02SdZ1Qf9GeYzkdUBGEeFl2lp387jub 0e7j6Mng==; Received: by zero.zsh.org with local id 1rnHU8-0008CF-At; Thu, 21 Mar 2024 12:25:28 +0000 Authentication-Results: zsh.org; iprev=pass (csmtpq4-prd-nl1-vmo.edge.unified.services) smtp.remote-ip=84.116.50.41; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from csmtpq4-prd-nl1-vmo.edge.unified.services ([84.116.50.41]:47359) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rnHTt-0007ru-3o; Thu, 21 Mar 2024 12:25:13 +0000 Received: from oxsmtp1-prd-nl1-vmo.nl1.unified.services ([100.107.83.138]) by csmtpq4-prd-nl1-vmo.edge.unified.services with esmtp (Exim 4.93) (envelope-from ) id 1rnHTs-002YaU-QC for zsh-workers@zsh.org; Thu, 21 Mar 2024 13:25:12 +0100 Received: from oxbe6-prd-nl1-vmo.nl1.unified.services ([100.107.83.10]) by oxsmtp1-prd-nl1-vmo.nl1.unified.services with ESMTP id nHTsrV9nAwUVGnHTsrqISu; Thu, 21 Mar 2024 13:25:12 +0100 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 100.107.83.10 X-CNFS-Analysis: v=2.4 cv=EPEA0UZC c=1 sm=1 tr=0 ts=65fc2728 cx=a_exe a=BaxG2yfOxHMHApbdv9TgGQ==:117 a=IvlwODmuRu4A:10 a=IkcTkHD0fZMA:10 a=YR4_K0clAAAA:8 a=FCOAEBppZ_1-5imERIAA:9 a=QEXdDO2ut3YA:10 a=HbQOABYz3jhqdZF7JfnK:22 a=waMAY2KAzxQUlx2gRwsv:22 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1711023912; bh=YWpgYhFedOhIswcZYIyq3QkMtb0Yp9McuofS5AZca34=; h=Date:From:To:In-Reply-To:References:Subject; b=N9DtYuAgWGb6bHTsVqyzbvvXSHMXzhi2yeQVfgEbQLXk4YNjYZ3aoR2ynBMQpBYIp xbVxyzcLBhDCXhlOezcJQpAsGNAjGT9ph1d6fIEWYdcIgpozE+JyMzSxt6wDEXdhNN gdaDJ6qKnlX86J4LF/Gps5GXhTsJW/T1w2J13r98PVsCPk8nqTOcaaQ/QT0RNGk8yO 7VanOiRVLm/srMwuxcvtyBlW7bdD/uBBXHvG4zFt0G3u8a1cOGjKcg6qLNDO0xxWjw gTlpvl92V37ruCBAreuiuQQPxewrVGMzh6LRZRWEAcWMkP4dv9iVGy6hAU+2DfTUhq H1JO4jKp7h+dw== Date: Thu, 21 Mar 2024 12:25:12 +0000 (GMT) From: Peter Stephenson To: zsh-workers@zsh.org Message-ID: <409557737.5903555.1711023912772@mail.virginmedia.com> In-Reply-To: <20240321121826.GD164665@qaa.vinc17.org> References: <20240321100710.GA164665@qaa.vinc17.org> <1443395979.5911218.1711016896863@mail.virginmedia.com> <20240321110444.GC164665@qaa.vinc17.org> <1507569659.5899391.1711020579178@mail.virginmedia.com> <20240321121826.GD164665@qaa.vinc17.org> Subject: Re: behavior of test true -a \( ! -a \) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer X-Originating-IP: 147.161.224.196 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfIwYwrXzx+zXD20KxJDJkgpeckaiPJBMAnGCGjUmrbmqrPJdezpSLqzC8ulpzIO3Pkg0+1UzDksoasLGlOkpVncBDOIm8yFGSYYVhAzaiGMfqEdX37aw Oyetg31/0tM336QsYGNQejYLG488AOT6403VB7D842Zs8MU2Wloh1FfXlgAM5gtGpUZzA6++C0KEHlSKwoSPozzQqA5a9wqu+drUUN6+sf4mF+2tumZBY1sD X-Seq: 52794 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: > On 21/03/2024 12:18 GMT Vincent Lefevre wrote: > On 2024-03-21 11:29:39 +0000, Peter Stephenson wrote: > > I suppose as long as we only look for ")" when we know there's one to > > match we can probably get away with it without being too clever. If > > there's a ")" that logically needs to be treated as a string following a > > "(" we're stuck but I think that's fair game. > > > > Something simple like: if we find a (, look for a matching ), so blindly > > count intervening ('s and )'s regardless of where they occur, and then > > NULL out the matching ) temporarily until we've parsed the expression > > inside. If we don't find a matching one treat the ( as as a string. > > But be careful with the simple > > test \( = \) > > which you may not want to change. This is currently the equality test, > thus returning false (1). Meh. I think we factor out simple cases with two or three arguments and assume they aren't doing grouping or logical combinations, so that might be OK. Obviously once we're into more complciated expressions it's going to get fraught, but keeping the simple cases that test was originally designed for (and ideally should only ever be used with) working is a good goal. pws