Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math: Allow "x" for multiplication #5906

Merged
merged 1 commit into from
Jun 10, 2019
Merged

Conversation

faho
Copy link
Member

@faho faho commented May 30, 2019

It's always a bit annoying that * requires quoting.

So we allow "x" as an alternative, only it needs to be followed by
whitespace to distinguish it from "0x" hexadecimal notation.

See e.g. issue #5650, #5324.

The obvious counterpoints here are that people will still try * (i.e. how many people do we save from having to ask?), and that it's a tad unclean. It might even lead to confusion if people try to spell hexadecimal numbers with spaces between them. The counter-counterpoints are that all we can do is try, it's not that unclean and that hex numbers are rarely used, and we don't support arbitrary spaces inside of numbers anyway (python supports _, but AFAICT it requires writing your own strtod, which isn't my idea of a fun weekend).

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.md

It's always a bit annoying that `*` requires quoting.

So we allow "x" as an alternative, only it needs to be followed by
whitespace to distinguish it from "0x" hexadecimal notation.
@faho faho added this to the fish 3.1.0 milestone May 30, 2019
@mqudsi
Copy link
Contributor

mqudsi commented Jun 9, 2019

fwiw, the type of people to use hex in a shell are probably the kind of people that would be caught dead writing 0x deadbeef with that space in there. +1 from me!

... however, I have always wondered if I'd still be able to look myself in the mirror if we special-cased * for math.

There. I said it.

@ridiculousfish
Copy link
Member

LGTM

@faho faho merged commit d1ca392 into fish-shell:master Jun 10, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2020
@faho faho deleted the math-x-multiply branch September 23, 2021 09:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants