[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Re: Surprising behaviour of 'append' with strings
From: |
Drew Adams |
Subject: |
RE: [External] : Re: Surprising behaviour of 'append' with strings |
Date: |
Sun, 6 Nov 2022 21:45:24 +0000 |
> > As a bonus, 'my-append' should check that all elements are strings, or
> > list of strings (no nested lists, and no other data types).
>
> Use `cl-every' on the result of `my-append' with a `stringp' predicate.
Maybe. Depending on what OP means by "should check".
Maybe he means silently filter out anything that doesn't check OK. Or maybe he
means raise an error in that case. Or maybe he wants a report (e.g. a list) of
all such "bad" elements.
Maybe he doesn't mind creating multiple copies of lists, to do the checking.
Or maybe he does care.
If he wants to know all of the "bad" elements then he needs to always traverse
the whole list. If he wants to raise an error as soon as the first "bad"
element is detected, then he may not need to traverse it past the first element.
- Surprising behaviour of 'append' with strings, R. Diez, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Eli Zaretskii, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Jean Louis, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Emanuel Berg, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Emanuel Berg, 2022/11/06
- Re: Surprising behaviour of 'append' with strings, Michael Heerdegen, 2022/11/06
- RE: [External] : Re: Surprising behaviour of 'append' with strings,
Drew Adams <=