From: Dmitry Gutov <dgutov@yandex.ru>
To: Kaushal Modi <kaushal.modi@gmail.com>,
Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: What's the canonical way to check "alistp"?
Date: Thu, 1 Mar 2018 17:33:56 +0200 [thread overview]
Message-ID: <dcfe09ec-754b-69bc-d004-647723138a1c@yandex.ru> (raw)
In-Reply-To: <CAFyQvY2gC8E2jzvSFKiGm4k2mELHAm3mk6MSBKhTLvJEj+Sa0A@mail.gmail.com>
On 3/1/18 5:29 PM, Kaushal Modi wrote:
> On Thu, Mar 1, 2018 at 10:21 AM Kaushal Modi <kaushal.modi@gmail.com> wrote:
>
>> What's the best way to check if every element in a list is also a list?
>>
>
> I don't know if there's a more concise way.. but this seems like a good way:
>
> (if (eq 0 (cl-count-if (lambda (el) (not (listp el))) MY-VAR)) ..)
(seq-every-p #'consp alist) if we're checking for an alist.
Use #'listp otherwise.
next prev parent reply other threads:[~2018-03-01 15:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-01 15:21 What's the canonical way to check "alistp"? Kaushal Modi
2018-03-01 15:29 ` Kaushal Modi
2018-03-01 15:33 ` Dmitry Gutov [this message]
2018-03-01 16:36 ` Kaushal Modi
2018-03-01 17:06 ` Drew Adams
[not found] ` <mailman.9955.1519924176.27995.help-gnu-emacs@gnu.org>
2018-03-05 19:17 ` Robert L.
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dcfe09ec-754b-69bc-d004-647723138a1c@yandex.ru \
--to=dgutov@yandex.ru \
--cc=help-gnu-emacs@gnu.org \
--cc=kaushal.modi@gmail.com \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.