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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27963 invoked from network); 23 Apr 2021 23:34:34 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Apr 2021 23:34:34 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619220874; b=pNqi2VAZRmWZ8B2HzIoDiNn6EPx3x4GE4hGHYkUOraXjb4Nc8vWJB8UaftVTok8luf9LQSkdL9 9Gfy3UhmnJsxJ0CqLVoGpYw3SFn8lRrQzfiz8+1jxYTCDANKhmE5Jh18wNYS4tCMQMDgrpTwtt e4jlF2UFlnNGyaVBePJC2luOZLiCNhb83YiQPOjQ0l9Gike80WOoveusiEMTUlKvUbS8vryC2M Rj5IBL/fw0FO+untG9W906jO85L/7PlNtKXB+sBV4rJeIVySCTR+a8C0rpweKDwE/zUZXNU08l iuvLtJASTFhGKUPKUP9wVLRQU6EeTRzsjPzDAh3oEJZEpA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oo1-f44.google.com) smtp.remote-ip=209.85.161.44; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 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-20200801; t=1619220874; bh=PCTZyNn9vnFViudi3VQ7k/KFLQSz6rN4oBsl2L1y9Gs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=fy6JWQoYrJ7N45ZpBmqat7UMfAMnfZ5AuyjJnbhAVzct3NdfnoUg0p+b8zPSJFrHu0iFZHdnHR RIQSbW6smbLRiCshtUI6jgA+uaprtR1g1qK5WfkoCpWhks5f1sfGl3azcn6kkW220IqDQUcabk FBc9zHigCMVFTSeZJxsUTpG0CEYDyMKgMQNVeMuwGL2y8+ZmcqiyKNpLjRV2oIsQBpwazKchhi 0CiIWR3ltG59H6tyvMFScPCgXMNC9TvDjtm7mRSSI0PLisRFFAxN+mlqcmB5mb7Ha95QgtTPkr Bp2Tbcfb2BnZv+dndomc5faKEQ4j9SXIB8Vyp4I3charhA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Lkv+3aYE423/iWRHe1i1Fd9mLw4IcjiUFMvJ8I0zuSM=; b=fweJ/8PqeIxDpCKP7kOzTz64aB 3WR82nGHBQSDK66QXgPNyHZbEuLJjgBqY8qd9C1PbP/LnkbbkVP9dDWYI3QFFvtMPP/vrdNk9esiL /M/pd70h4rDGj/K5KBAMcaF2ReAUFQ6zSgXXgiDJfM5bo/EdLBcbOxmYjtQcviLzyiFvSyL8bzQ1g A53LkV1gLX4aG08ip22+wkez+WcK6Oq6MqqkxPsIrnWwvaTNlG9FEPISz6HDdLlF+qC1ZNpHl1+xF 2r5hNIFri483iAVS4MtnlWIeuwN+BE0soneTbCHXlLnHiAdBI4PKdeqn0NaYDLfR1F2Liou7O4Wo6 yv28LwTQ==; Received: from authenticated user by zero.zsh.org with local id 1la5Jh-000Lx5-8L; Fri, 23 Apr 2021 23:34:33 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oo1-f44.google.com) smtp.remote-ip=209.85.161.44; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oo1-f44.google.com ([209.85.161.44]:40528) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1la5JQ-000LiA-QT; Fri, 23 Apr 2021 23:34:18 +0000 Received: by mail-oo1-f44.google.com with SMTP id i9-20020a4ad0890000b02901efee2118aaso3435056oor.7 for ; Fri, 23 Apr 2021 16:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Lkv+3aYE423/iWRHe1i1Fd9mLw4IcjiUFMvJ8I0zuSM=; b=Yz2ywSlp4VnP/9WiZDuqTWxHoFaMADXWqEN+8xJ7AfVPG7mNFuNdu4p3gjiLV1airf yjCkAieqoRG8KXYcNQ5q65taS0/8spmIvonrS3+NgKnIDOVOAgD6rhEwiil/VTDfkVYi t3QeH02mj3ofBCfVmcbvJQiFTk/4KxmJtLADxid/I5KHe2CK8z+cpZBPm3bPmdl9fvMv 73DojqYner/Euo6YccEh/xcKiXIQmgISdhAJYRyitdFvmi/+LPWW54MVAwYdZ7vd9ula YBkHvWCDzKnP0qc/1H6auzWL7xvfA8bRj3RP1PDsA9bcLZibtfPgdayLgds3KMEtCLE8 UPZA== 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; bh=Lkv+3aYE423/iWRHe1i1Fd9mLw4IcjiUFMvJ8I0zuSM=; b=PNBm8IrmN+u4I5nMPI/AF4zYQoGsLYFJIJwoHsUwHN0ZM0J1fNiTv4EQ67alE9f0Dq 4wGyWkY4IcRXEQ0la/JX6sIq3SlOmejMkW+TRtqibwgrKliIQ02YEpZsDpUv1kK/IKlX 4mprQEkRfCBf0xK7SL8QDPd8p6KcMGjDEQzkPApSaJJyymEmdFm0BB2+GM3mSMbvhez3 +dKTIVXRYTJUrf7OyAxZrTODrKwKMDNdaNbZkpNm/taBtzV8yxuqmHbDhaS8sNXgYffw T6RxWNTjdQibFVXJ36FMtWC3Ke83vRmOs5X9goFzQJWVZXq0nJ9ALKNF6yAtOtNzfIIe efIw== X-Gm-Message-State: AOAM531iSxgQ3X2ZAtDMuBCSEYqHv4GX2eH4aSGjGlZQY9bmvV3mVK61 //FfQohZ5CQdHOvAOWsi6Co6Gt7ksq7NfY/nr8VvLVHonvzSPA== X-Google-Smtp-Source: ABdhPJztEGm5doRlGj6SjUhIyF3zF7hIN2qgZJdARQ1Hbfx08JxV2SysfmZocj3SLtd/1LYEZKR/1x1dDK8t0xOnRyE= X-Received: by 2002:a4a:6b04:: with SMTP id g4mr4631307ooc.78.1619220854980; Fri, 23 Apr 2021 16:34:14 -0700 (PDT) MIME-Version: 1.0 References: <7FD930F4-37CD-402B-9A06-893818856199@dana.is> <20210411175726.hxnm33mxoska2tsm@chazelas.org> <20210411193154.zkekzvb4o6xmriwo@chazelas.org> <20210413071742.tisslgg5fdqbageg@chazelas.org> <20210422153100.GD154089@zira.vinc17.org> <20210423164525.GA2033191@zira.vinc17.org> <55222-1619218004.791735@3FXq.NU49.vlrg> In-Reply-To: <55222-1619218004.791735@3FXq.NU49.vlrg> From: Bart Schaefer Date: Fri, 23 Apr 2021 16:34:03 -0700 Message-ID: Subject: Re: sh emulation POSIX non-conformances ("inf"/"Inf" in arithmetic expressions) To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48683 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, Apr 23, 2021 at 3:47 PM Oliver Kiddle wrote: > > I can just about see the case for warning on typeset -i/-F inf or nan > but not on use. Warning on -i/-F but not on simple scalar nor on array/hash is not very useful because math context doesn't limit expansions to just numerics. > If we're worrying about POSIX compliance, it'd be easy enough to disable > Inf and NaN in POSIX mode but there are dozens of special variables Inf and NaN are actually lexical tokens in context, so it's not quite the same situation as special variables. > Bart Schaefer wrote: > > + if (issetvar(p)) { > > + zwarn("%s: using constant NaN", p); > > I'm not sure that "constant" is even the correct term for what NaN > or even Inf is? Perhaps not. The patch was more to show the cost of implementing the warning than to attempt to get the warning text right. > > integer Inf > > print $(( Inf[0] )) > > 1:Refer to Inf with an array subscript > > That could potentially be made to work as an array lookup because > subscripts have no other meaning that would clash. Here though you mean array lookup in math context generically, not specifically for variables with these names?