emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lexicographic list comparison


From: Emanuel Berg
Subject: Re: lexicographic list comparison
Date: Sat, 10 Sep 2022 11:22:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Mattias EngdegÄrd wrote:

>> Or maybe sorting lists of lists is just such a rare op that
>> no one has ever encountered it before me?
>
> It would be useful to have a total ordering on Lisp values:
> for heterogeneous ordered collections, for simplifying
> multi-key sorting, for normalising unordered
> collections, etc.
>
> The devil is in the details: are strings compared with our
> without properties? Do we observe the wonky IEEE rules for
> ordering floats? Is there a particularly useful ordering
> between elements of different types? Do we need to worry
> about circularity? How do we compare hash tables? And so on.
>
> Consistency with `equal` would be desirable (up to hash
> table identity, perhaps).

Interesting, what is this, type theory?

Sounds like something that is available in Haskell maybe ...

What is the benefit if you have it? Sort things recursively
and with no fear running into data of a type that would
wreck it?

It's easy to do, (order-pair a b) which accepts any an all
data and returns the list (a b) iff a < b. It could first
check types, then delegate the task to the existing
greater-than function for all cases that ... makes sense.

Making up rules that makes sense for everything that don't
make sense to compare is maybe more difficult ...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]