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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17934 invoked from network); 6 Jan 2023 18:13:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Jan 2023 18:13:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1673028783; b=puz5ICk3cgQydg6ZRzr+62sjtA7H1IB/JtMzDHNFZDf/76wouVPq5AqOEwzry3aT8lPsfPiSTz fS4cOh5JgMKr0nlmrCI9V6K2gss2eYH5qv8ux1s5u8qm5Pg/T6UaLuIcey6ai9+Rvks1kXLyg+ yKHh8+WjMPUe2ByN/cY3vUOt+FJ9W5AsaJnrZ1rcNSptOc1bnOokSziYgLPrLjIpPmshI5JWnV 8z3Msh00WErCwtYa+0yaP8I/Gi4Z2utWtkKimzLYAnz60yNntKLGhhOpzu5oHqfsR+xm2V0JkR xU7vFuiiPWiLMNN2Ppu0y7hw+E6M6O2uEqDCkNVdVOE+1A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f44.google.com) smtp.remote-ip=209.85.208.44; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1673028783; bh=YUIVrlxRi5OUSwnkMJhkwONeJkCHW2Ek6sR2naL2tVE=; 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=MVh8ZJ8FqbqpGLhTQQAuTmtvthBTOHAv+3ZpmGdzeb8J6laNQ85Z68o+qUpBxmVqlO3apJ16B5 TmVwI87L4VgZfC3OXrgd/FJxnFD2IkoLdlQmB7lrQnd5YIJ9kmJehEy6VIou0bjxbLR1tM6Wj/ EJ7gUf8OfGL6dyXkKrZZiKNlbyoazlbtYGTnQDYko8tezMvS31hjzjnehaiEWYEsr3h0BhqAiK 7Q3SrJht8LHbptvjDPfVqHfr2JVOR02b1E0Vpr7153IHZvLT6+dobTMuQlIlOXLTcV4ZWyefAw AZL94EfDLozvhvFPHPJYk+j7blwvRhLtHik1UAaW7jrpPA==; 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=9M64Jo/2LnTf5k1fiR6++w0MyDn6Ux9/Sdhhwvat6uI=; b=MG/hsAmQ5ZYk8nCPQah3B5PiqI 1fxqdlnrg0GIYEFT4x59LGJ2a61n8YTOWx9thuJxyQBvhIMY43L0OJwnNuTPHiOrNXGrkA47wt7S6 /PmMz6XRR48hILHPkUXYujtxnbrPxeBlFp8+/alcLYlxvb2Bx/Hxrp1e+KlPjpU6d3y+RDZuRjbM9 DFO3YRvzGG6tM5ujsCCuhktGlfBSiOnIZAxEIhEAzWEOY04Oz4suLdDHcxrfxw28f4eayj0LeyQ8P mcwPAlQQL0TRXAZ3D7u1wxbKgRuPQKN4eBTyTYjoe3/ZTAaU/E/a2k55nN76cRp82blKdlPjU8Y1r SQaB1Oaw==; Received: by zero.zsh.org with local id 1pDrDC-000PuK-TW; Fri, 06 Jan 2023 18:13:02 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f44.google.com) smtp.remote-ip=209.85.208.44; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f44.google.com ([209.85.208.44]:45047) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pDrCf-000PbD-BH; Fri, 06 Jan 2023 18:12:30 +0000 Received: by mail-ed1-f44.google.com with SMTP id j16so3269408edw.11 for ; Fri, 06 Jan 2023 10:12:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9M64Jo/2LnTf5k1fiR6++w0MyDn6Ux9/Sdhhwvat6uI=; b=wfX8iiAZ37phAY5Mk4x5iqN9rj9YbEWAJyQXbmQNRl9flTAbdt5LVcpDVbHyHrwfv8 wsD14N/U+lHJWJ96Ijb7HjtEA2dLJJ3nao6WR4YSvBgQQMaXBSlDcMbqHqW9NGfBZ+xK CIGHI7h5fMJxvDGYe0HNyTCWd6HBpvPdYRaK7tpqiKkFt2O24LQHQRbF9B3HEMKRBPqL Q+H7m6xr2gie4ysnX8ZbOxe2YB9J1HlrAC58ivtlTlhuSpMygjNxA/hK26IbDoXiNAmG r1BsaADcUga6w/icO5LwW2UE7yrgcTKMLXqxx1J28KoggVSaKFjb3mIVtm+yIO3WG34z 5xkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=9M64Jo/2LnTf5k1fiR6++w0MyDn6Ux9/Sdhhwvat6uI=; b=MU1aXgLi0IKM9gydgQUJb0+kNYoqbpb+elNHG35tm2nPcE9bLavQwZKv7r4jLdPUFs 3H4c2cWqvfagcqSrFENtK7iMKv16JxRJkOehm+bcZYr3hoOCytbHfSSkEgrm7P7+41ob Vo2f5mHZsChJXq0Ozy2NWOPNK2EW8xQSu4u3/WdRWguMI7ElZOqnLOGkPNxjv5XpBqiS IqAKTkN1XBVkJbslQFGU4VFSZCa4f67EAvGGm1Zy9dgjZBouD51oDVat/SpW0iSMjHHR jkSw2WUoFFfQyFY1Wmcs+ITHYCe2c59VRmWSFTPcDgjmGjdqOTd6A0TTd4O2FOLMr4HE 6+Xg== X-Gm-Message-State: AFqh2kopx6PcqiFMoJFFNGbHcueq7ZSyEq9bLV3e5Qe19/783TkeUXNa eQ2ldunqrKPy2VS124+yn38RMlcjwcaesRefqu7Hcw== X-Google-Smtp-Source: AMrXdXtpfUcvN7EuQbDAqZXgK6Rh9dpT13fxzqjbd4hvjwGpUyUQl41aLTo9YtP9Nr4LNNTFCe2/3d2LKNv5D8SNe+Q= X-Received: by 2002:a05:6402:cbb:b0:48e:ae51:7a72 with SMTP id cn27-20020a0564020cbb00b0048eae517a72mr1303928edb.364.1673028748946; Fri, 06 Jan 2023 10:12:28 -0800 (PST) MIME-Version: 1.0 References: <361494476.8470860.1673025799682@mail.virginmedia.com> In-Reply-To: <361494476.8470860.1673025799682@mail.virginmedia.com> From: Bart Schaefer Date: Fri, 6 Jan 2023 10:12:17 -0800 Message-ID: Subject: Re: Subscript flag (i) not working correctly on empty strings? To: Peter Stephenson Cc: Philippe Altherr , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 51279 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Fri, Jan 6, 2023 at 9:24 AM Peter Stephenson wrote: > > > On 06/01/2023 16:01 Philippe Altherr wrote: > > > > > s=; echo $s[(i)z]; > > > > > 0 > > > > Why is the last line 0 and not 1? > > Certainly looks plain wrong. > None of the existing tests fail with this change. I thought there was a discussion about this at some point in the past ... but it may have been limited to array cases. I have the feeling we concluded that (i) and (I) should produce the same result on empty string for purposes of boolean tests, but I can't find such a conversation in the archives. I remain a little concerned that some scripts are going to unexpectedly break, but can't point to anything, and $anUnsetName[(i)z] returns nothing rather than 0, so it's probably an unfounded worry.