[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [External] : Re: Shrinking the C core
From: |
Yuri Khan |
Subject: |
Re: [External] : Re: Shrinking the C core |
Date: |
Sun, 17 Sep 2023 21:34:24 +0700 |
On Sun, 17 Sept 2023 at 17:46, Emanuel Berg <incal@dataswamp.org> wrote:
> For example, (+ ...), (- ...) etc are preferable to
> (arithmetic :operation 'addition ...),
> (arithmetic :operation 'subtraction ...) etc.
Let’s reframe that in more real-life examples. What is preferable and why:
1. a couple of functions
a. ‘(my-sort-by SEQ LESSP)’ where LESSP is a function accepting two
elements X and Y and returning ‘t’ when X should be sorted before Y,
and
b. ‘(my-sort-on SEQ KEY)’ where KEY is a function accepting an
element X and returning a number such that sorting by that number
yields the desired order; or
2. a single function that could be called as ‘(my-sort SEQ :by LESSP)’
or ‘(my-sort SEQ :key KEY)’, with the same semantics as above?
Does your answer change if we want to extend the API to also support
sorting in descending order? If it does, how?
- Re: [External] : Re: Shrinking the C core, (continued)
RE: [External] : Re: Shrinking the C core, Drew Adams, 2023/09/13
- Re: [External] : Re: Shrinking the C core, Arthur Miller, 2023/09/14
- Re: [External] : Re: Shrinking the C core, Emanuel Berg, 2023/09/15
- RE: [External] : Re: Shrinking the C core, Drew Adams, 2023/09/15
- Re: [External] : Re: Shrinking the C core, Emanuel Berg, 2023/09/16
- RE: [External] : Re: Shrinking the C core, Drew Adams, 2023/09/16
- Re: [External] : Re: Shrinking the C core, Emanuel Berg, 2023/09/17
- Re: [External] : Re: Shrinking the C core,
Yuri Khan <=
- Re: [External] : Re: Shrinking the C core, Emanuel Berg, 2023/09/17
- RE: [External] : Re: Shrinking the C core, Drew Adams, 2023/09/17
- Re: [External] : Re: Shrinking the C core, Emanuel Berg, 2023/09/17
RE: [External] : Re: Shrinking the C core, Drew Adams, 2023/09/15