[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to mapcar or across a list?
From: |
Marcin Borkowski |
Subject: |
How to mapcar or across a list? |
Date: |
Wed, 15 Jul 2015 22:14:20 +0200 |
Hi there,
so here's my problem: I have a list of Boolean values, and I want to
`mapcar' an `or' across it (IOW, I want to test whether at least one of
them is true). Of course, (apply #'or my-list) does not work. Of
course, I can (cl-reduce (lambda (x y) (or x y)) my-list) -- but is
there a better method?
BTW, my-list doesn't really exist: it is a result of `mapcar'ing
a function taking some value and yielding a Boolean value, so bonus
points if the method does not process the whole list.
(Note: I just noticed that my-list is in fact sorted so that all true
values (if any) will occur at the beginning anyway, so I can just test
the first one. This means that my problem is purely academic, though
still interesting, I guess.)
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
- How to mapcar or across a list?,
Marcin Borkowski <=
- Re: How to mapcar or across a list?, Rasmus, 2015/07/15
- Re: How to mapcar or across a list?, John Mastro, 2015/07/15
- Re: How to mapcar or across a list?, Emanuel Berg, 2015/07/15
- Message not available
- Re: How to mapcar or across a list?, Pascal J. Bourguignon, 2015/07/15
- Re: How to mapcar or across a list?, Emanuel Berg, 2015/07/15
- never use `eval' (was: Re: How to mapcar or across a list?), Emanuel Berg, 2015/07/15
- Re: never use `eval' (was: Re: How to mapcar or across a list?), John Mastro, 2015/07/15
- Re: never use `eval' (was: Re: How to mapcar or across a list?), Emanuel Berg, 2015/07/15
- Re: never use `eval' (was: Re: How to mapcar or across a list?), John Mastro, 2015/07/15