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 780add7d for ; Sun, 10 Nov 2019 23:41:33 +0000 (UTC) Received: (qmail 14544 invoked by alias); 9 Nov 2019 09:10:26 -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: 24417 Received: (qmail 19750 invoked by uid 1010); 9 Nov 2019 09:10:26 -0000 X-Qmail-Scanner-Diagnostics: from mail-ua1-f48.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.222.48):SA:0(-2.0/5.0):. Processed in 3.727178 secs); 09 Nov 2019 09:10:26 -0000 X-Envelope-From: sgniazdowski@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.222.48 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=O0Wn9OzvnhexHsZJB2AxCpiXFIlkWPAdJHQmRfPPMKk=; b=JBI6yDqfBo+jUfKgyqPrspaSyaVZjd/VS481K3WfQgO/QUH13zXvrQMmFTKojXNgqj ZEKn3+WQXmxyQTt1r7US73LzBbMISG0WhjasYEHIDzVYYenh8l04MCMDGJqHhaMHD2A+ SjOvhR3c7tOCWTedz4AKZn3QiLfFndUICcf3uBJRID0s/qloHMH4z0zhQlndbUD2kYic VxnwDBuMVbN+LUU31l01sv6xZtbC+r0iCiKEozUE9hPbsDFCGJOPjy40X6GctMxDIYaM XE3JoGkiubeSuWZTWVq42/64ct2nxu+CRKSWqD0Z9mGW5rdOXD/x3dR0/nddMFMWHOWJ 5gfQ== 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=O0Wn9OzvnhexHsZJB2AxCpiXFIlkWPAdJHQmRfPPMKk=; b=YcMsEXM6Sj5vLq7QuQcEAZbiknsSObRs611kwfEcM66EeGsxYiUBHhqwH4tz3cvNea Ukoy4kNC6CooO05ozj8HmyK8ovBBC1OFidXve5n9Gqk4QGXr9KmSglBC71c486UueLU0 ZO0i4GRXTazw5PJALw0s9YclHISBbWNjGHtRhXSTaJihdq3ypZwKU+ZsnXypgb/Jq8J/ bO4JCPWRnpyQ22/Du0l0Lzh3x3gXRj5ly4DOe3oHPj0GF2Xp8gtjwakwnr491kh0HN6K YK7rnXjyY8IOVBtgQBFIXBi54Zn3sZ7yyLqT0HzxIiUPdI0PWQbCmsxEbdrvyq6tYvl5 89kA== X-Gm-Message-State: APjAAAVrhD7Ay2jZMvH9ZF8ksJz+3xr4DKrM9rL4rXR71Zd7hLYA/qWh 90QxSU3lkhsgXzNDTfK8h15OBpjqPYfOqOwDQoOD1w1qcRY= X-Google-Smtp-Source: APXvYqwCw6qtBW1CE/FAnIrF1o+bXAUewBQjpqDqWWOGAayZFcfES9auVjlUKEBvAZTeG5rCmhx0DpZ7INcTtS9Lkfs= X-Received: by 2002:ab0:1896:: with SMTP id t22mr9806792uag.82.1573290589009; Sat, 09 Nov 2019 01:09:49 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Sat, 9 Nov 2019 10:09:44 +0100 Message-ID: Subject: Re: What's the reasoning behind z & s returning nular for empty input? To: Roman Perepelitsa Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 9 Nov 2019 at 09:52, Roman Perepelitsa wrote: > > On Sat, Nov 9, 2019 at 9:40 AM Sebastian Gniazdowski > wrote: > > Yes, I was also referring to this fragment, however it states that the > > empty elements should be removed, and even =E2=80=93 that they should b= e > > removed more eagerly, so I still wonder why produce a nular for an > > empty input? > > Oh, I see what you mean. Apparently, only inner empty elements are > dropped by "${(s...)...}" while the first and the last are retained. > > "${(s:,:):-a,,b}" =3D> (a b) > "${(s:,:):-,,}" =3D> ('' '') > > Looks like it's either a bug in the code or in the documentation. True, I wasn't fully aware of that: array=3D( "${(s:,:):-,,}" ) print -r ${(q)array} Output:'' '' array=3D( "${(s:,:):-,}" ) print -r ${(q)array} Output:'' '' I think that the documentation or the behavior should be updated. --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org