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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 061fe880 for ; Sat, 17 Aug 2019 06:30:52 +0000 (UTC) Received: (qmail 16013 invoked by alias); 17 Aug 2019 06:30:47 -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: 44678 Received: (qmail 3763 invoked by uid 1010); 17 Aug 2019 06:30:47 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f49.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25538. spamassassin: 3.4.2. Clear:RC:0(209.85.221.49):SA:0(-2.0/5.0):. Processed in 2.354807 secs); 17 Aug 2019 06:30:47 -0000 X-Envelope-From: stephane.chazelas@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.221.49 as permitted sender) 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:content-transfer-encoding :in-reply-to:user-agent; bh=OaCwy2HAkKGuGTzR5ZQw1kxFZNpmT6f9fuBV8oBuuOE=; b=Ir/O3FKLik/8uUBvtZfZuzkAHHMu0Ebm44Ze7bqYVymnl8/QUsp+xYyfJxxPWnPO5M 6JmcKOwAyJyluxoJBGMnpOcGF+U1K4kgRZYsbuxQm/6OoTaHyjD0Ty8w8SUwGfnc+a28 dRIocsH+PXSWRQNYdT+yc9lA4jkHVug05/OJJy7zI6XoqRa1e+0oBJz4AfTvthSYwQfO XH7EuHGhr3IobL/KiFClerVk/lnt5dFWY2Mbw5xg+4vXW4hGUvQNecwjTqllfTtg0+GU 9USweQfhdslw7cC8sKNuQs7cWentuOuuwr1ewZOQ/GZQYTQaI0XQyEyUe7QBXVTEJeOV N07w== 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 :content-transfer-encoding:in-reply-to:user-agent; bh=OaCwy2HAkKGuGTzR5ZQw1kxFZNpmT6f9fuBV8oBuuOE=; b=sKw623vxX2uKt1F+sp6ZwDYwSmKTo8YOUTr/KYS9T1G74s9uOgX3wpfS9DL6IHEuko Qnom7nXR7ek11B1E6kZp1nqf4M3v0SlwnWaO1qxth7c+87bepBPxfxjQNa5K7Hi2v3b3 ZGdOkmhwDKr2kTmey5sn8/T6dYZFg5mB0VeXxisyfR+DO73qhT4nHwHvEWkY7nDNUuOT 2c96iCq+zEHitrySLyzdeuPRK5rOFXBasyIdic6VExeqFbqvBmEGVMpV917JSj0wQApl yznxEVlNfWUaGNbTTpXGIkWHujaA5Uy1W0V9FJDCyKnrBntr4Zw7jbj9y1Woi1JtaWpR rY6g== X-Gm-Message-State: APjAAAW18S7cH0S03ddIBdllrifPWVRfcE9RCjxZtco8VEHo9+3zGYpR jOh38eZAJipxSaDAz6qTQ+ImYfpOetU= X-Google-Smtp-Source: APXvYqw7od860WqjKA2wfcV+hOm4L6ZdYXJq+eEdovHvAJqBwd0SW88qAmTIUosQUMwhhuxRC3BnMw== X-Received: by 2002:adf:e30e:: with SMTP id b14mr12698846wrj.168.1566023411376; Fri, 16 Aug 2019 23:30:11 -0700 (PDT) Date: Sat, 17 Aug 2019 07:30:09 +0100 From: Stephane Chazelas To: Bart Schaefer Cc: "zsh-workers@zsh.org" Subject: Re: [Feature Request] Adding option to support triple quotes Message-ID: <20190817063009.7niz4cz2tuqx3ksu@chaz.gmail.com> Mail-Followup-To: Bart Schaefer , "zsh-workers@zsh.org" References: <2c845fb0-d628-400f-a805-ad8356b6d87a@www.fastmail.com> <7EBD1ADA-7179-4EEF-97CA-DBE4371D80D6@icloud.com> <876f807b-dfdd-4246-8cfe-7cf6f373ac88@www.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20171215 2019-08-16 22:31:11 -0700, Bart Schaefer: [...] > So if you really want to make progress with this, start looking for > something more akin to perl's q{} and qq{} as already mentioned. [...] q{} would be a non-starter since it's already valid syntax. q(...) for '...' qq(...) for "..." qqq(...) for $'...' qqqq(...) and more q's reserved for future extensions like ksh93's $"..." may be workable. (and \qq(...) or 'q'q(...) would be a literal q followed by q(...)). perl allows \( and \) to escape ( and ) (and as a result \\ to escape \) inside even the q(...) form, I'm not sure I like that: $ perl -le 'print q( \\ \(\) () )' \ () () '...' can quote anything that doesn't contain '. q(...) could quote anything except unmatched (...) pairs. I'm sure everyone will have wished for a kind of quotes (à la TCL {...} or perl q(...)) that can nest when writing things like: ssh host 'find . -exec sh -c '\''for i do sed '\'\\\'\'s/... ' Which you wished you could write: ssh host q(find . -exec zsh -c q(for i do sed q(s...)...) zsh {} +) That's the same kind of reason we got $(...) to replace `...` On a related note, I really wish the glob*(e'(code $(...))') worked, as in the code that looks for the closing ) for the e glob qualifier would find the matching ")" as opposed to the first one (same in the s/j... parameter expansion flags, etc.) -- Stephane