unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>,
	"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Re: Surprising behaviour of 'append' with strings
Date: Sun, 6 Nov 2022 21:45:24 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488B07A3334584B8B702AB2F33D9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87y1snbz6l.fsf@web.de>

> > 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	other threads:[~2022-11-06 21:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6554cc02-2082-3dca-73cc-05fee1c6c4d0.ref@yahoo.de>
2022-11-06 11:05 ` Surprising behaviour of 'append' with strings R. Diez
2022-11-06 12:13   ` Stephen Berman
2022-11-06 12:35     ` Emanuel Berg
2022-11-06 20:28       ` Michael Heerdegen
2022-11-06 20:57         ` Emanuel Berg
2022-11-06 12:19   ` Emanuel Berg
2022-11-06 12:32   ` Emanuel Berg
2022-11-06 12:37   ` Eli Zaretskii
2022-11-06 12:39   ` Jean Louis
2022-11-06 20:33   ` Michael Heerdegen
2022-11-06 21:45     ` Drew Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB5488B07A3334584B8B702AB2F33D9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).