help-gnu-emacs
[Top][All Lists]
Advanced

[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.



reply via email to

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