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

boolean values are not comparable #1585

Closed
krader1961 opened this issue Jul 23, 2022 · 0 comments · Fixed by #1588
Closed

boolean values are not comparable #1585

krader1961 opened this issue Jul 23, 2022 · 0 comments · Fixed by #1588

Comments

@krader1961
Copy link
Contributor

While working of #1570 I tried this to verify that a constant key results in no change to the order of the inputs:

> order [1 3 2 5 4] &key={|a| put $true }
Exception: bad value: inputs to "compare" or "order" must be comparable values, but is uncomparable values

I thought I had a bug in my &key implementation but it turns out that the current Elvish implementation does not support comparing booleans:

> order [$true $false]
Exception: bad value: inputs to "compare" or "order" must be comparable values, but is uncomparable values

Yes, this is an odd thing to do but it should be possible to compare booleans. Note that this isn't a problem with the order command -- it's a problem with the compare command (whose implementation order uses for comparisons):

> compare $true $false
Exception: bad value: inputs to "compare" or "order" must be comparable values, but is uncomparable values
[tty 25], line 1: compare $true $false
krader1961 added a commit to krader1961/elvish that referenced this issue Jul 25, 2022
krader1961 added a commit to krader1961/elvish that referenced this issue Jul 25, 2022
krader1961 added a commit to krader1961/elvish that referenced this issue Jul 25, 2022
krader1961 added a commit to krader1961/elvish that referenced this issue Jul 25, 2022
xiaq pushed a commit that referenced this issue Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant