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 97a329c3 for ; Sat, 9 Nov 2019 08:23:10 +0000 (UTC) Received: (qmail 18922 invoked by alias); 9 Nov 2019 08:23:03 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24414 Received: (qmail 19085 invoked by uid 1010); 9 Nov 2019 08:23:03 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f53.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25622. spamassassin: 3.4.2. Clear:RC:0(209.85.166.53):SA:0(-2.0/5.0):. Processed in 0.721324 secs); 09 Nov 2019 08:23:03 -0000 X-Envelope-From: roman.perepelitsa@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.166.53 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GAUhLP1dcFp2cR6VkhUqmEsLrp+WFEjxpDKb8tBe16E=; b=q9uXAyKNGlilOqF/yEI7euMUtNcgTMGFlDmaSW55Q8WbuPtygW0dNwgQv81emcT7cs SKRpumF9D1XdiXJHw1Bx7QjUMu3RIodEOu67Z3shYF+bJyIWCs/fNWTL9I5GEHsSANQ6 1Vy53cxz67txub9mJWq6/AkNLN0JobPE01qQ0R4JuUBaJtTYmiNvl82EXBQ6nBoHkUB/ 30VO2+Fo8zaP3umzKTBsZWysGf3fHNnV6rSQc+bP+TvDcCLETyCP9J+yuznKhCmQMTZ4 2kLsitgJ6c294YS1KIFdywm7CVbDXUWXyxgT0c+s61GMBIAORvmRGOpmgeYIujgmDUjt 0VwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GAUhLP1dcFp2cR6VkhUqmEsLrp+WFEjxpDKb8tBe16E=; b=M3MsQQDP7u8JMe1G/S1W+6G7ZKHszlYYkMUPlNr2QcEWVOI0W1kte95AmBxVzIYIbp zGwzbB331CS+2Yyy+gO16KVkm47CEtc5H529ulYfC4VMmD2vJr1mOMyaQ9pClYJodrXn spN4/r+uQZYlt8SxZT9ZEsuPukaVhuYlgVTAIO0lmdSCgKnHY/j3WvaE69tBo6xhY1y0 0d/ZmvRbMzDhNMs/5abrNJG1wgaWffv2yzNPrZBe0A2tFPW4yKLoYsawSCkr/EtgTDbR mC2EdtivsDgTFtkj9ihVSzCOukqws47rgZbJl9CUN6Bzt8fjYaHJFeHoYVlemO/eJTdJ s8DQ== X-Gm-Message-State: APjAAAXRqnMpWLldqcaEDVdLHq1YXb6D53b/ciPU0L1H0Ntlqv04adAJ rB9sqRmvADLp3+CalusipSUK+VBQ9bqqf+wFqBw= X-Google-Smtp-Source: APXvYqyeZVTk0OlC8iREjRpei5uGpHajiJa3I+y/f5scT3Rzw46fL1ZqYsGqRnn+DQy9iUz6uyuIxJG66cMi0vshTt8= X-Received: by 2002:a02:c4cd:: with SMTP id h13mr15930832jaj.33.1573287749575; Sat, 09 Nov 2019 00:22:29 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Sat, 9 Nov 2019 09:22:18 +0100 Message-ID: Subject: Re: What's the reasoning behind z & s returning nular for empty input? To: Sebastian Gniazdowski Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Nov 9, 2019 at 9:11 AM Sebastian Gniazdowski wrote: > Thanks for the analysis. The additional problem is that quoted but > @-lacking s-flag should still elide the empty elements, as the manual > states. So this is an intentional exception and I wonder why it has > been added? Here's the passage from zshexpn: For historical reasons, the usual behaviour that empty array elements are retained inside double quotes is disabled for arrays generated by splitting; hence the following: line=3D"one::three" print -l "${(s.:.)line}" produces two lines of output for one and three and elides the empty field. To override this behaviour, supply the =E2=80=98(@)=E2=80= =99 flag as well, i.e. "${(@s.:.)line}". The phrase "for history reasons" is used to describe past design decisions and/or implementations that would be different if the benefit of hindsight were available at the time, but changing which is infeasible due to the existing code relying on the current behavior. In other words, the current behavior is unfortunate but cannot be changed. Roman.