From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Florian Beck Newsgroups: gmane.emacs.help Subject: Re: Checking if all values of a list are true Date: Fri, 11 Jul 2008 13:51:19 +0200 Organization: T-Online Message-ID: <87bq14oczs.fsf@sophokles.streitblatt.de> References: <2d973602-87f8-4d16-a031-a99bab267a36@y21g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1215780057 17739 80.91.229.12 (11 Jul 2008 12:40:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jul 2008 12:40:57 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 11 14:41:44 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KHHwL-0000Sv-9H for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jul 2008 14:41:33 +0200 Original-Received: from localhost ([127.0.0.1]:34536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KHHvT-00032Z-HK for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jul 2008 08:40:39 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-X-Trace: news.t-online.com 1215777079 01 27604 n3fIOeBrULQu3Sf 080711 11:51:19 Original-X-Complaints-To: usenet-abuse@t-online.de X-ID: rYWYJ-ZJoel1EmhLO1R2ifc4i0WDP2EJOKkGwCc3QukFbxREDSZ14g User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:DSsa/Soe2744NRKD1UGzjMLc4js= Original-Xref: news.stanford.edu gnu.emacs.help:160084 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:55429 Archived-At: Nordlöw writes: > On 11 Juli, 13:33, Nordlöw wrote: >> On 11 Juli, 13:23, Nordlöw wrote: >> >> > How do I check if all values of a list are true? >> >> > This is my attempt: >> > (reduce 'and '(t t)) >> >> > but I get the error: and (invalid-function and) >> >> > (functionp 'and) >> >> > gives true so why on earth doesn't this work? Maybe because 'and is a special form, not a function. Try (reduce #'(lambda (x y) (and x y)) '(t t t t t t t)) > It would be even better if Emacs already had a function typically > named any-p(arg-list) that returned t if all values in arg-list are > non-nil. Something like (defmacro every-p (list) (cons 'and (eval list))) CL has 'every: (every 'eval '(t t t)) -- Florian Beck