[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: lengths and stuff
From: |
Tomas Hlavaty |
Subject: |
RE: lengths and stuff |
Date: |
Sun, 27 Dec 2020 21:52:36 +0100 |
On Sun 27 Dec 2020 at 10:52, Drew Adams <drew.adams@oracle.com> wrote:
>> Using length in a predicate is yet completely different and most
>> likely bad because to answer the predicate, traversing the whole list
>> is wasted time and energy.
>
> (lambda (xs) (= (length xs) 25)) ; need to count elts
Is that a joke?
The predicates were proposed to help programers avoid writing such bad
code. And if somebody writes such bad code, it is almost trivial to fix
it with search and replace:
"(= (length" -> "(length="
"(< (length" -> "(length<"
"(> (length" -> "(length>"
"(/= (length" -> "(length/="
"(<= (length" -> "(length<="
"(>= (length" -> "(length>="
Also the "symmetry" (or exhaustiveness?) here is to assist in easily
fixing bad code with minimum changes.
Nothing of course helps to those who are determined to unneccessarily
count _all_ the elements of lists.
- Re: Internationalize Emacs's messages (swahili), (continued)
- Re: Internationalize Emacs's messages (swahili), Jean Louis, 2020/12/28
- Re: Internationalize Emacs's messages (swahili), Eli Zaretskii, 2020/12/26
- RE: Internationalize Emacs's messages (swahili), Drew Adams, 2020/12/26
- lengths and stuff, Daniel Brooks, 2020/12/26
- RE: lengths and stuff, Drew Adams, 2020/12/27
- RE: lengths and stuff, Tomas Hlavaty, 2020/12/27
- RE: lengths and stuff, Drew Adams, 2020/12/27
- RE: lengths and stuff,
Tomas Hlavaty <=
- Re: lengths and stuff, Jean Louis, 2020/12/28
- Re: lengths and stuff, Eric Abrahamsen, 2020/12/28
- Re: Internationalize Emacs's messages (swahili), Eli Zaretskii, 2020/12/26
- Re: Internationalize Emacs's messages (swahili), Richard Stallman, 2020/12/27
- Re: Internationalize Emacs's messages (swahili), Eli Zaretskii, 2020/12/26
- Re: Internationalize Emacs's messages (swahili), Daniel Brooks, 2020/12/26
- Re: Internationalize Emacs's messages (swahili), Eli Zaretskii, 2020/12/26
- Re: Internationalize Emacs's messages (swahili), Daniel Brooks, 2020/12/26
- Re: Internationalize Emacs's messages (swahili), Eli Zaretskii, 2020/12/26
- Re: Internationalize Emacs's messages (swahili), Daniel Brooks, 2020/12/26