Re: sorted?

[email protected]
Newsgroups gmane.lisp.guile.user
Message-ID <Z1bslzjn/[email protected]>
On Mon, Dec 09, 2024 at 01:58:08PM +0100, Mikael Djurfeldt wrote:

[...]

> No problem---I'm too.
> 
> Think about it this way:
> 
> How would you sort this list of numbers: 7 1 3 8 2 1 4 ?
> 
> It's 1 1 2 3 4 7 8, right? That is what we want (sort '(7 1 3 8 2 1 4)) to
> output (+ the parentheses of course).
> 
> Now, `sorted?' returns true if its input is what `sort' would have produced
> as output, otherwise false.

Hmmm. Perhaps, what throws me off the rails is that you can pass
a "less" predicate to sorted?.

To behave like it does, it has to have some notion of equality,
which seems to be implicit and doesn't necessarily harmonize with
the less predicate you pass to it.

Something like that.

Cheers
-- 
t
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZ1bskAAKCRAFyCz1etHa
RpyIAJ9uSdxYWHQbG9yugRUMUSv85E75WQCdEEIqQiwbjZeKfEOVWMFBpNsK1C0=
=iW5N
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.