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 3837 invoked from network); 22 Apr 2021 21:26:08 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 22 Apr 2021 21:26:08 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619126768; b=fcrN/1P36HXvbwFXCns7XMUzYOrnMe+5hCMi7xqLTFvCu8JQcnAbnGUDXUhm3Fy899kqBeiPD4 E6QMun9bTrEVjnBY7C3fA4wTOKGUUvR21X3/cT7Yi0jxqT8qr0vjHDoy3/xVqfPvbMl/584XYR CFOGFT2WR6eAs0Ru3c5TZCB/qu4OHe75MlR7FviD6BEq6moy/z+dlxzHLug/MjmGJm+yQ+wygD +DvKHcpVTnHhA77MKUAG46L71R6VKduwFD1i1rDcRYN1irkuAes8Bq6cyij+dYc3NUyWLhIKGr /uqNfbnau9oR5sY0+7IG+LzP+19bfOQx/txtrdtbWRvzFw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oo1-f54.google.com) smtp.remote-ip=209.85.161.54; 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=1619126768; bh=BZa5z4SRU7FARHusASCPbsD3hxGAKlwOke69lCFT6FA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=oxPuL6GdltLtQrCAB/BgguQBBEkDUlXfnWPdNE4OrEsodt79Q9baPbS1MJv657tkQy5WyUeWLU JxfQcWj6tqc70+vX5hHbDHPWJYYHJ+F1ryTzQE9+KJHwj8Cfkz0uKGID2gTEOQkapmWHJ58C8F KGgLvgO4/ZyoavtySxluXhYsGmMP5rT49N09iTyRSDSqC8CWQZmZDgHAQTi+qTiQOcxuS/Ln2a wN75p7vOZ8uNLC0y0MggpjP37gzJRbg3LpuPLIW1vMJWxrmu+/uUIuGt1J2jDMIV/Fc2OFxSif 5eO1eF0rpXheAkU5/+Fh0cZfvfh5Okc7WnSIogJb2rV1Xw==; 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-Transfer-Encoding: Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=PmCA6FxeErhwqm4LDAA4nJVYdKKdLFxzyiyLd3qaxUI=; b=oJIVvcwKnUI3/DEP9gkbiCXLpJ yPVeVVzHavvONTNi4h10/+7arx4nrUuJ15d/N9+5jUngjRfxe+WtMdaQ3BXLf+Ye1xAOuRiVVGY6O 9rCHMIww+EU5FqSSU8UFL/9cJT0J9yre+/18rQets+uLFuOplqtne7NeeEff3G+nzXQdlUM3paJDv FinDUhdRMb5E3APOmhngmUENUphcC2de276FbCr1Itzef0PNeKLp0VR+J7UE9cj6IVgplbmTqAg0k l8C9qluqwCUjkQGLlmAH6iWKu478/XO/75LxdZHeK33XnnkMsY5kTwY2uES1fRMuv7fA2TpKxVsIs KXQrbfjQ==; Received: from authenticated user by zero.zsh.org with local id 1lZgpq-000K4H-RX; Thu, 22 Apr 2021 21:26:06 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oo1-f54.google.com) smtp.remote-ip=209.85.161.54; 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-f54.google.com ([209.85.161.54]:46835) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lZgpb-000JpM-Oq; Thu, 22 Apr 2021 21:25:53 +0000 Received: by mail-oo1-f54.google.com with SMTP id a188-20020a4a4cc50000b02901f0ae7068a1so2238907oob.13 for ; Thu, 22 Apr 2021 14:25:51 -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 :content-transfer-encoding; bh=PmCA6FxeErhwqm4LDAA4nJVYdKKdLFxzyiyLd3qaxUI=; b=2KKEKldSoE5duNgnlIW75LKsV0lVrYPwv3/aWudqg37rlQBdW09gCKmQlj2rgQk4r3 wtr06gPLVuf80FZRNI/p8FjuidaonvyduIjuejhL2aB4rkfhkySJ3yqnBcq+4xpWXSEp 1AfMJq/grKJ+uib0nOfndeO/LCy/wHE04Lz+RQXrYfkWe2X3cbGdZHwL0Q3WFnwISfen y8UYde0T8R/EWcNfLmy4+S2wCP9M+UTC52ppgyOIyCkq7wA1fjF9zjJnHE0YVRTPX96M wPXpcYsz7AQd1RHG1ay3iOhF3iJvo8PZNqUbi0ODduQEMBgzDJBzFbw6C9QbX0Hyp1Xv Nmaw== 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:content-transfer-encoding; bh=PmCA6FxeErhwqm4LDAA4nJVYdKKdLFxzyiyLd3qaxUI=; b=KzUMTJvoFmDMNsuI0x4NGXhZgir9SB5/NB5Dz5XqlT25Ms1n46mbg9MfZIE8rzfo0g FO9pSQp5q1hCartZOG3H8buzT6TwyBp94LLJpaP3TFTJNnb8NYNzisNxH6uIbkhyunhJ ni2gWgOcn9TqzTtkDZD2woxtkDF+oJxlksKBBb+C6gscgoyVtV6NZV46a7lAu4juTlfq Bf7HvcPVjwYXrzNd7UIR5w0L8Dwknvbd455Q0i6uozgROCv2Oi6S2aLLLh20yb/Xd1Vv HNr1723T4Mil+UKEElQLyqDLKzRyPgGEkeoDz5dr3Jxtrraxlf/y9jsckkbkDSzTWBQF 8tpg== X-Gm-Message-State: AOAM532bXg5GQfAUC+ledBRQK7JnMVxLwnu47Ool8oyuvSFhTq6iY8DH tf3CyOW/0W53IlXNekTMJc9ImoHKg2R9tAoKY2VytXE7GnI= X-Google-Smtp-Source: ABdhPJyJ9/tnheJv8FXZpN0/Y8LeI8Hjm83xmyciGsv3FCgWQbRK66YVTQhcLFSxRG40LCkhdtTb1pftdig/SPlapro= X-Received: by 2002:a4a:df0a:: with SMTP id i10mr398241oou.82.1619126750369; Thu, 22 Apr 2021 14:25:50 -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> <20210422204531.GB13421@tarpaulin.shahaf.local2> In-Reply-To: <20210422204531.GB13421@tarpaulin.shahaf.local2> From: Bart Schaefer Date: Thu, 22 Apr 2021 14:25:39 -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" Content-Transfer-Encoding: quoted-printable X-Seq: 48663 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 Thu, Apr 22, 2021 at 1:46 PM Daniel Shahaf wrot= e: > > Warn only when the variable is created, e.g., upon =C2=ABtypeset -F inf= =C2=BB or > =C2=AB(( nan =3D 3.14 ))=C2=BB, but not subsequent assignments? The latter is already an error. The former warns spuriously if the user has no intention of ever mentioning the variable in math context (or of ever using math at all). And the problem exists in math context whether or not the variable is declared to be of a numeric type. > Predefine $inf and $nan as readonly float variables initialized to the > respective values? (Not saying this is a good idea; just mentioning it > for completeness) The constants are case-insensitive, so we'd have to predefine twelve names. And we couldn't do this in POSIX (sh) context, which sort of defeats the purpose. I'm waiting for Vincent to tell us when/where he thinks the warning should come from, but I don't think there's any sensible place for it. The only good solution would have been to pick otherwise-syntactically-impossible tokens in the first place (as Vincent also mentioned), but it may be too late.