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,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28274 invoked from network); 2 Jan 2024 14:52:21 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 2 Jan 2024 14:52:21 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1704207141; b=h/SW5dwnSCTgtUmNNc1gloR5Nl+4EKK9wCbqmNAy8+dXxOGY1TVuuynnA5qsUaWeSYEjObxAF7 Uj/Wm6T1eGBQLdQ5K0RZSVYQyI2wCTnQNHHCrxrnmo4iOqJQKXvhVloqwJHDjg4+mfkhAQ4Qqv HEjmukpGSY4Ilmkz9enydeAo2SyHOjeq3ZDHCFSrt/pBD1hPzkjiSBdHmXSWR0IiCfPRBxxqrl h9huvLcKyNqv0u0f5Hm3rNR5LMSlNnjxB8MlqWFMOcrMPaxv7exvgIEP+Ddv8BvNLO1eEM2CaO j+K3bQsQ8Bg79WKf0JDDaPr5GaKiQn0i/4AMi1Vapwg2FA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f182.google.com) smtp.remote-ip=209.85.208.182; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1704207141; bh=0g93lv3cY2p5re/YQGgj/iy2wdHLgW1t83OHjfMdH+0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=VPuLRn+XjCcRyHJ7nY8gGJu0WHdVANQVklLxqB/yw1kgkE5ElUQQNotbvygzTZ0lsBrZ2D36P0 6yHv8kXXRI0hYBQFVJUiOVuoBtLLomld8jRF/V+Qz3ojTxJ/WZHU6b8J4Upr42JhGxFDysRsXf kU+lKBoGgzhLe+Gn7oDx6KBea0Ws9rKL9bz+H5usW/KTkfNyJRdrBbVSILcBQCvSGNiLqrbULx iGYwypZH/iOydXX7lgz8RXpl/noOzbPLPmLflnr3PpnNgGbLm3Mbs7Nw+o8e9imfiMFoTGUXCw c5LjUAgn+7IDfeytZLrD3fMR/8XZtfh5nYV/m/m9oaY4aw==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References: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=sWyTo6XJyE7nUHKWJyU1IgWvv3sxglIc5G54sNzSP70=; b=djJbOHZ11RjUFSv2G42n0nuenT FCV7JI3cWjXArka3GsSATk2ouYdyMHVwTQD3azvx15gsdMqNEsQE05jRUxY5xTtQD6Mzy31lD9R68 A/Jicova17tZlay9Zy3LjavVSOyD9e50pH7LmWFn014skDhOkEKM13c0i5zmc+TJciiX/FEf/BEZP YO660oZg+3inlMZdr2o04Wg8uW4kwXmLM1X+3FhOmnSdBP/467xI1sfzKcNy8ydEURGcj+yvek9v9 O/bPoPnR1lamYqpp0u6LAjljh2WvX94z0l/2bxy/ySfhl1mFw2ACiM26fq5vGqKRfyd/ThL8YktxK qkvJXjHw==; Received: by zero.zsh.org with local id 1rKg7u-0004H8-DE; Tue, 02 Jan 2024 14:52:18 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f182.google.com) smtp.remote-ip=209.85.208.182; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f182.google.com ([209.85.208.182]:49294) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rKg6t-0003aK-2O; Tue, 02 Jan 2024 14:51:17 +0000 Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2cd053d5683so14116771fa.2 for ; Tue, 02 Jan 2024 06:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704207074; x=1704811874; darn=zsh.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sWyTo6XJyE7nUHKWJyU1IgWvv3sxglIc5G54sNzSP70=; b=M62M5FZTk0q/+mb/jlYoLhR/+KtVvH1yLHiBUx9qhedzk0f2j9f3Dp6qKRKv+rOCPK Pyr+ewfgOgPrAjVZC+Oz0cP9QlcV4rMcampDlHe16WEzgbaImJRJILBJqQw9s5A14K/+ hccQX7qG0OgcCX/3GSFiWM4VWGCihDHApslOdoku5jeUXqlw53dP/AYWC+BHMMklA8p1 gOfJ5fD10rAIZWHXarep82zVphKgI988IKw9pdbJBf4afmm0r6k/YRhMkRLZnMoTEcUZ qebCNh1jv2BhhdR/6nUQUTcqJ60GcxSlsXfTtspL865dsJIrg8MWFvoKEiuTv3G+8tiB 0uzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704207074; x=1704811874; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sWyTo6XJyE7nUHKWJyU1IgWvv3sxglIc5G54sNzSP70=; b=WXnblCbsbBqX+6yLGjTEBAsXY1p3aDd1FBLmR9ZzsrhuNr/xqh4180YGqBqEJRItbH cvTD67s0FJStVzx1W/lFnfzY8yas60Jsd94t4drKXRcmixsHHicrkH4ZZkM4jsoZOsNL rangMB9VwKNy2tGP5UdgOW+anUUSbgkTwn6x0n/mD4hfy9nDiRkBguOH3pibgOqKKNaO i2bUSx+by2j1CBMiEi1olYlH00HmQL5fy5TqyLzKQ17GPWQQr7pNkbHpVShlTy1QdzdN fmHkBmwAKCaPClx68+mwFPFwMNdH3zOBMDwAOWAFQLAbMoQmUhSmJG1VhFoYmazlR5RP mlbA== X-Gm-Message-State: AOJu0Yy8t2MuvjxgVShGrsAixfqyUCWyzMGWwf3DoP+1MJANpKEf2F3c xuMVMYpWGEJqmgFwOVFDNU0rinGiqWsa4TW+mje6neQzxs0= X-Google-Smtp-Source: AGHT+IHfmL3kz1UuNZhLhhVhf+UMLIO6HOgMB6ZX+hp0K1CuFwDFHeIjw4TI59Ontw7kkcNMvjsB55reWPConqXTgdo= X-Received: by 2002:a2e:9dd2:0:b0:2cc:7718:edff with SMTP id x18-20020a2e9dd2000000b002cc7718edffmr7460632ljj.70.1704207073955; Tue, 02 Jan 2024 06:51:13 -0800 (PST) MIME-Version: 1.0 References: <69024621-9e60-474f-9c32-4edaecc3ff68@eastlink.ca> <07ddd352-0c1b-467e-9d4c-ff46020ccf41@eastlink.ca> <707f3c88-b222-45b8-9512-30830ec02a88@eastlink.ca> <1f5d8cbf-72ac-4699-98ac-dfb7dd2a44fd@eastlink.ca> In-Reply-To: <1f5d8cbf-72ac-4699-98ac-dfb7dd2a44fd@eastlink.ca> From: "Mark J. Reed" Date: Tue, 2 Jan 2024 09:51:01 -0500 Message-ID: Subject: Re: zmv exits from function To: Ray Andrews Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000445266060df7a1ee" X-Seq: 29398 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000445266060df7a1ee Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Dec 31, 2023 at 5:07=E2=80=AFPM Ray Andrews wrote: > > On 2023-12-31 13:44, Bart Schaefer wrote: > > On Sun, Dec 31, 2023 at 7:53=E2=80=AFAM Ray Andrews > wrote: > >> So that's multi-pass parsing. > > Again, no. It's only parsed once > > I don't have the background to understand it and it's probably not worth > your time to make it clear. > It's not parsed multiple times, but it _is parsed fully before anything runs. _Parsing_ is just reading the code and determining what it means; actually _running_ it comes later. Zsh parses the whole expression before it executes any part of it =E2=80=93 it doesn't just stop and execute the f= irst thing that looks like a command. So it has already read the `always` block and knows it's there before it executes the code to the left of it. And the presence of the `always` doesn't affect parsing; the code on both sides works the same way it would without the `always`. The only thing it does is tell Zsh that, as long as the code on the left doesn't exit the shell entirely, it doesn't matter what happens there; the code on the right needs to get executed next. Even if the left code interrupts the normal control flow with a `return` or `break` or `continue`, the code on the right will get executed before the next thing, wherever that next thing is. --=20 Mark J. Reed --000000000000445266060df7a1ee Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Dec 31, 2023 at 5:07=E2=80=AFPM R= ay Andrews <rayandrews@eastlin= k.ca> wrote:

On 2023-12-31 13:44, Bart Schaefer wrote:
> On Sun, Dec 31, 2023 at 7:53=E2=80=AFAM Ray Andrews <rayandrews@eastlink.ca>= ; wrote:
>> So that's multi-pass parsing.
> Again, no.=C2=A0 It's only parsed once

I don't have the background to understand it and it's probably not = worth
your time to make it clear.=C2=A0=C2=A0

It's not parsed multiple times, but it _is parsed fully before anythin= g runs.=C2=A0 _Parsing_ is just reading the code and determining what it me= ans; actually _running_ it comes later. Zsh parses the whole expression bef= ore it executes any part of it =E2=80=93 it doesn't just stop and execu= te the first thing that looks like a command. So it has already read the `a= lways` block and knows it's there before it executes the code to the le= ft of it.=C2=A0

And the presence of the `always` d= oesn't affect parsing; the code on both sides works the same way it wou= ld without the `always`. The only thing it does is tell Zsh that, as long a= s the code on the left doesn't exit the shell entirely, it doesn't = matter what happens there; the code on the right needs to get executed next= . Even if the left code interrupts the normal control flow with a `return` = or `break` or `continue`, the code on the right will get executed before th= e next thing, wherever that next thing is.

--
Mark J. Reed <markjreed@gmail.com>
--000000000000445266060df7a1ee--