zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Martijn Dekker <martijn@inlv.org>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] POSIX arith: inf, nan should be variables
Date: Tue, 16 Nov 2021 10:06:49 +0100	[thread overview]
Message-ID: <24930-1637053609.517514@-QOU.SIKw.N7wo> (raw)
In-Reply-To: <f45c480a-a7ac-54fc-4140-665ff98f9dc6@inlv.org>

Martijn Dekker wrote:
> $ zsh --emulate sh -c 'inf=1; nan=2; echo $((inf)) $((nan))'
> Inf NaN
>
> Expected: 1 2

> So, what shell option to tie that to? That's a bit difficult. It needs 

The closest comparable feature is the decision in params.c as to whether
it should setup other special variables that aren't in the standard.

That seems to only check something like !EMULATION(EMULATE_SH) rather
than an actual option. Much of that has to run before zsh has got as far
as sourcing dot files that might setup options so it likely never made
sense to create an option for it. Most uses of directly checking
emulation state seem to be in initialisation code.

I wouldn't rename an option for compatibility. And while OCTAL_ZEROES is
similar in controlling interpretation of numbers in math mode it differs
in that it enables a potentially problematic standard feature while
Inf/NaN are a zsh extension. So I wouldn't view preferences on them as
being intrinsically linked.

Oliver


  reply	other threads:[~2021-11-16  9:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 17:40 Martijn Dekker
2021-11-16  9:06 ` Oliver Kiddle [this message]
2021-11-16 12:55 ` Vincent Lefevre
2021-11-28 20:34   ` Oliver Kiddle
2021-12-01  3:31     ` Daniel Shahaf
2021-12-01  3:37       ` Bart Schaefer
2021-12-01  4:27         ` Writing XFail tests (was: Re: [BUG] POSIX arith: inf, nan should be variables) Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24930-1637053609.517514@-QOU.SIKw.N7wo \
    --to=opk@zsh.org \
    --cc=martijn@inlv.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).