From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7f3f9e84 for ; Sun, 16 Dec 2018 19:15:50 +0000 (UTC) Received: (qmail 4928 invoked by alias); 16 Dec 2018 19:15:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43901 Received: (qmail 16675 invoked by uid 1010); 16 Dec 2018 19:15:34 -0000 X-Qmail-Scanner-Diagnostics: from mail-pl1-f194.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.214.194):SA:0(1.7/5.0):. Processed in 2.257717 secs); 16 Dec 2018 19:15:34 -0000 X-Envelope-From: joeypabalinas@gmail.com X-Qmail-Scanner-Mime-Attachments: |signature.asc| X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=naF+NAccmEkXe+mWsMqe7UijvMv15JQq6pZ7atmZ424=; b=dbTz8UcwsAna5yXhCDZtj+8hhEhDjjbqAnyGRbC3CQuFGCvqPAkDC7A1UTWs7OjY1K 2sJ42FSBigo8iVdYOZPq6sr8I11lHyuKNCZSOF0j4VJE5pCwCq33LwiagZs89QJfesqN 7ScIpaHQN6fdZiflu2ildNGSEIug7KaRgP6jLVws9Vihi2zMYL5rovs11FvDEEa5RE0V Ypn9xJb9WUZFbMV+5Tc2dp7QvjcfeyPbuqQ7D1EnS4dbkZWekpEyBw7K272Lw5nPUsuU uxtVzoe/kGheajs971GCgdeLUhbhfsIvYtw/o9UlE8m9qz3INgfo9iivGMoXuwxU3U2/ VfHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=naF+NAccmEkXe+mWsMqe7UijvMv15JQq6pZ7atmZ424=; b=IidAXyqkVTAqEKXfriHT9afOWyEoUifn4aKUfGYhKGtZ9dd5r07wrhdWCAS7xmmxXh FbS+6WzpfhoEB0FGkCsxQq08LuCgTZ65sKqVd+50tTHDCH9XVRhzyDag8CY+poPZqWV5 CjdsftmnfnY0nLa3oh9swUjxM5EPfaq1PSJWiuO/X1aZNxpdzhr4od5Iej3uVEjKxXO8 ZE5YyLnIFzksEAxGJCEl4pZNHHts0iuFrOZZhpJRb3tMuXis62Eh8c6/vbfcwo7bUAfu FWVpegmfrh6wEQEmkWCDfKmEimbOMkpsJKBOrfCkfLjm57nZH/k092vecQ/jgRb15Bkh /U7A== X-Gm-Message-State: AA+aEWbpW5TykvWFdevAENOqEHjwxCha4f1qXRHDjqkT9gc4RpZFjio9 BD4agpgoFK9Q6xQ+9Fir3UM= X-Google-Smtp-Source: AFSGD/VTJBQeXXzmdzg5svVGZLbCGvUVgYB3VN6WaUnwb4fqVRmALAglHiVtwSSj6Hk5hVAYlS7+eQ== X-Received: by 2002:a17:902:7201:: with SMTP id ba1mr10122432plb.105.1544987728106; Sun, 16 Dec 2018 11:15:28 -0800 (PST) Date: Sun, 16 Dec 2018 09:15:24 -1000 From: Joey Pabalinas To: Daniel Shahaf Cc: Joey Pabalinas , Bart Schaefer , Zsh Workers Mailing List Subject: Re: [PATCH] zshmisc(1): document implicit append of `term` when `in word` is omitted Message-ID: <20181216191524.ejjtkuyoud2fzasg@gmail.com> Mail-Followup-To: Joey Pabalinas , Daniel Shahaf , Bart Schaefer , Zsh Workers Mailing List References: <8afdae3ebc75741d47d657f29fb7d2876f9536b2.1544905398.git.joeypabalinas@gmail.com> <1544925190.621790.1610325216.065C6F48@webmail.messagingengine.com> <20181216020127.bdskejrh2ckxrg5n@gmail.com> <20181216115408.2bkygixkx7eymqvp@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="okla2jkydoamhhws" Content-Disposition: inline In-Reply-To: <20181216115408.2bkygixkx7eymqvp@tarpaulin.shahaf.local2> User-Agent: NeoMutt/20180716 --okla2jkydoamhhws Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 16, 2018 at 11:54:08AM +0000, Daniel Shahaf wrote: > Let me begin by saying I'm not familiar enough with the parser to have > an opinion on whether it would be better to have change the docs to > match the code, or change the code to match the docs, or leave this as > an implementation detail that's subject to change. Agreed, that's probably a good idea. > All that said, I'm not too bothered by the grammar of the log message > (which is now explained in this thread anyway). I'd sooner suggest > changes to the new text: >=20 > > +++ b/Doc/Zsh/grammar.yo > > @@ -185,11 +185,12 @@ cindex(loops, for) > > item(tt(for) var(name) ... [ tt(in) var(word) ... ] var(term) tt(do) v= ar(list) tt(done))( > > where var(term) is at least one newline or tt(;). > > Expand the list of var(word)s, and set the parameter > > var(name) to each of them in turn, executing > > var(list) each time. If the tt(in) var(word) is omitted, > > -use the positional parameters instead of the var(word)s. > > +use the positional parameters with a var(term) implicitly > > +appended instead of the var(word)s. > > =20 >=20 > Two issues here: >=20 > 1. The docs of var(term) are spread across the first and last sentence. Yes, that is a bit awkward. I should find a better way to organize that. > 2. Adding a side remark about var(term) to the last sentence may obscure > that sentence's primary point about the fallback to positional > parameters. >=20 > So, perhaps something like this (relative to master): >=20 > -where var(term) is at least one newline or tt(;). > Expand the list of var(word)s, and set the parameter > var(name) to each of them in turn, executing > -var(list) each time. If the tt(in) var(word) is omitted, > +var(list) each time. If the `tt(in) var(word)' is omitted, > use the positional parameters instead of the var(word)s. > + > +var(term) should be one or more newline or tt(;), and is optional if > +the `tt(in) var(word)' is omitted. Aha, optional works great here. > But let's wait for someone familiar with the parser to opine on the > proposed strategic direction ("document the parser's behaviour") before > we spend too much time on implementing that. But again agreed, I'll wait for someone who knows the parser well (Bart maybe?) to chime in before I cook up a v2. --=20 Cheers, Joey Pabalinas --okla2jkydoamhhws Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEENpTlWU2hUK/KMvHp2rGdfm9DtVIFAlwWpEsACgkQ2rGdfm9D tVK7Uw//YjCxaQDochOzSSMLaISbimAvBytASIkcWafkN2YtcIG3zgDlG/qmDP8M NwGRZBYJUcixBjEyEqk8OMnK9jw4scSwcgeuyGib5lWpPogJJS2mHD4JQS2JHMCr T3XYkYh2oszUjRHdY/Zmtkjujjb/aPkXdfFTxURMxx3og4VzTC+7WMiUztQOsnij 1fucGjZx7UcF2/mEqoBm+sMyMYtUiE6bZ+3DbunM7AY6li0O/8AT1EYpJrBhLBR5 SH0D1u3VV5LWMtBA7URsnLReHrS0k36bSAISys3t0WsX7QjehTY3Bi8BxWq5Wg7N 7UkNpDLflAnwbR83YecvDf8W/PfiLfDxxpiGGGqNBjlUS/megzNruU6LPmwdmKg5 qMJyoxxPZrnagx5SkzMOdHZ1XnVPiDgDVMB/Eq3QG1qaky3i6Pvd29JAo5jpjRmF OxHneLf4qoHDEYb1vFtAObUrii7kcwiaRzDtrGvh6JRyFIVKAFBEl22VtPpLgW7h 2SfQeUpgf6BNKYHmvV5XSpLdnq2R0fHTeYBIfYIMt8SXyU+yuDhIk3cvtg/Xeie7 0X4yaOYqK+Px7ETRyu7DaxDdg5NjQHhW87IAeIpZQ7aABEDPH1SvG8ylCu/nCFpT x5UDm+UIMOkCM18DFb9UZ2yhXVK3h93x1NKd36DLRBCg12w0JxU= =gXcU -----END PGP SIGNATURE----- --okla2jkydoamhhws--