[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#69709: `sort` interface improvement and universal ordering predicate
From: |
Mattias Engdegård |
Subject: |
bug#69709: `sort` interface improvement and universal ordering predicate |
Date: |
Thu, 21 Mar 2024 15:55:43 +0100 |
20 mars 2024 kl. 20.37 skrev Stefan Monnier <monnier@iro.umontreal.ca>:
> IOW, I vote for `<`!
That may actually be within the realms of possibility. Some snags:
* Not sure if code using `<` and expect a type error for non-numbers would be
confused (probably not)
* Making `value<` n-ary would slow it down a bit, unclear how much
* `value<` compares markers by buffer then position, `<` by position only
* `<` can compare markers with numbers
* We expect consistency and shared code for all of < > <= >= = /= but it's
unclear how `value<` would be generalised in that direction (at least if we
care about NaN correctness)
Currently, `value<` treats NaN as if it were equal to any number, which is
terrible and useless but consistent with `<`. Other options would include order
NaN distinct from any number, perhaps just consider all NaNs to be equal and
put them before or after all numbers.
`value<` is actually quite a bit faster than `<` which has a terribly
cumbersome implementation, except for pairs of fixnums which apparently got
special-cased in `<` and the other inequalities fairly recently.
By the way, I ran some more benchmarks: it turns out that `car-less-than-car`,
the secret shortcut that you just had to know, now gives roughly the same speed
as :key #'car which is a lot more discoverable (and works for many other types).
- bug#69709: `sort` interface improvement and universal ordering predicate, Mattias Engdegård, 2024/03/10
- bug#69709: `sort` interface improvement and universal ordering predicate, Eli Zaretskii, 2024/03/10
- bug#69709: `sort` interface improvement and universal ordering predicate, Mattias Engdegård, 2024/03/10
- bug#69709: `sort` interface improvement and universal ordering predicate, Eshel Yaron, 2024/03/21
- bug#69709: `sort` interface improvement and universal ordering predicate, Dmitry Gutov, 2024/03/22
- bug#69709: `sort` interface improvement and universal ordering predicate, Mattias Engdegård, 2024/03/23
- bug#69709: `sort` interface improvement and universal ordering predicate, Dmitry Gutov, 2024/03/23
- bug#69709: `sort` interface improvement and universal ordering predicate, Stefan Monnier, 2024/03/23
- bug#69709: `sort` interface improvement and universal ordering predicate, Dmitry Gutov, 2024/03/23
- bug#69709: `sort` interface improvement and universal ordering predicate, Stefan Monnier, 2024/03/23
- bug#69709: `sort` interface improvement and universal ordering predicate, Mattias Engdegård, 2024/03/25
- bug#69709: `sort` interface improvement and universal ordering predicate, Mattias Engdegård, 2024/03/29
- bug#69709: `sort` interface improvement and universal ordering predicate, Daniel Mendler, 2024/03/29