From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11719 invoked from network); 23 Nov 2022 07:00:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Nov 2022 07:00:03 -0000 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-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=qbE2S7lgvW5wlx5Z9yeOgVKevUD2QcR6ZZeHyL2Bm6M=; b=bEgsKn0WsMEsVvAwVJ3qYuwdxJ a5amk6ZhJG08SdOHKRxZeRmKupiHACCAtNu5gByHGYYs7PfHv2+pebLsiT0TtWhxPEoheLpsB0Rkb 8JJUM8PQgACHpZicOKD6hHbbtUe8iH0Y+4y7sz1VN+VyMitDJfMbz3iHLtdlgrRFQQ2X2F8vpvc8u OWMFr8eguummX8xN9pPwgxTtTHBSDvitu5Un37OLN8apYRVcNaajmHa1Xcpdn9BgU/maetw7N6ioQ j8/eDnf2TNGj6q1hw7rZgpBucOOc8neAWdMYQN6o4oMvEh/Q8bC1ylExF7TNY6bjOGlRBXCqsNnEO oGpuZ0dg==; Received: by zero.zsh.org with local id 1oxjjm-000OXz-AJ; Wed, 23 Nov 2022 07:00:02 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1oxjjS-000OBY-He; Wed, 23 Nov 2022 06:59:42 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 9E89F27C0054; Wed, 23 Nov 2022 01:59:38 -0500 (EST) Received: from imap48 ([10.202.2.98]) by compute2.internal (MEProxy); Wed, 23 Nov 2022 01:59:38 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedriedtgddutdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderreejnecuhfhrohhmpefnrgif rhgvnhgtvgcugggvlhojiihquhgviicuoehlrghrrhihvhesiihshhdrohhrgheqnecugg ftrfgrthhtvghrnhepleekheejgfdufeegkeeugedugefhvedvleejheeiueffheevjefg heethfduvefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheplhgrrhhrhihvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduudeh udekjeejtdegqdduudelvdejfeekhedqlhgrrhhrhihvpeepiihshhdrohhrghesfhgrsh htmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: iaa214773:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 57A8331A0062; Wed, 23 Nov 2022 01:59:38 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: In-Reply-To: References: <230a78bb-fa97-4f3a-94a2-86982316274b@app.fastmail.com> Date: Wed, 23 Nov 2022 01:59:14 -0500 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Philippe Altherr" Cc: zsh-workers@zsh.org Subject: Re: [PATCH] Fix ERR_EXIT behavior in function calls and "always" statements Content-Type: text/plain X-Seq: 51030 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 Mon, Nov 21, 2022, at 9:52 PM, Philippe Altherr wrote: > To help decide what to do, here is a table that lists all the different > cases and how they behave in the current Zsh, in a patched Zsh, and in > a patched Zsh where anonymous functions behave as compound commands: > > Code Current Zsh Patched Zsh > Compound command (and patches) > A) false Exit Exit Exit > B) false && true No exit No exit No > exit > C) { false && true } No exit No exit No > exit > D) () { false } Exit Exit Exit > E) () { false && true } Exit Exit *No > exit* > F) () { { false && true } } No Exit *Exit* > No exit > G) f() { false }; f Exit Exit Exit > H) f() { false && true }; f Exit Exit > Exit > I) f() { { false && true } }; f No Exit *Exit* > *Exit* > > Currently anonymous functions behave like function calls. My patches > don't change that but they change/fix cases F and I to behave as > mandated by POSIX. POSIX does not mandate any behavior for case F unless one treats anonymous functions as compound commands, in which case the new behavior actually violates the standard. -- vq