[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the canonical way to check "alistp"?

From: Dmitry Gutov
Subject: Re: What's the canonical way to check "alistp"?
Date: Thu, 1 Mar 2018 17:33:56 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0

On 3/1/18 5:29 PM, Kaushal Modi wrote:
On Thu, Mar 1, 2018 at 10:21 AM Kaushal Modi <> 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.

reply via email to

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