-
-
Notifications
You must be signed in to change notification settings - Fork 315
Closed
Description
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
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Support comparing booleans (#1588)