unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* return first element in list with certain property
@ 2017-11-19 20:43 Emanuel Berg
  2017-11-19 20:51 ` Eric Abrahamsen
                   ` (2 more replies)
  0 siblings, 3 replies; 54+ messages in thread
From: Emanuel Berg @ 2017-11-19 20:43 UTC (permalink / raw)
  To: help-gnu-emacs

What is considered the right way to return the
first element in list that has
a certain property?

The best way I've found so far is `cl-some' and
then `and'. While I don't consider the
"`and' hack" to be detrimental in any way I was
curious if there was a complete
"hack free" way...

Example: get the first element that is bigger
than 1:

    (cl-some (lambda (e) (and (> e 1) e)) '(1 1 3 1 4 2)) ; 3

-- 
underground experts united
http://user.it.uu.se/~embe8573




^ permalink raw reply	[flat|nested] 54+ messages in thread
[parent not found: <mailman.4086.1511124258.27995.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2018-03-06  9:29 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-19 20:43 return first element in list with certain property Emanuel Berg
2017-11-19 20:51 ` Eric Abrahamsen
2017-11-19 21:37 ` Philipp Stephani
2017-11-19 22:55   ` Emanuel Berg
2017-11-20 18:51     ` John Mastro
2017-11-20 19:21       ` Michael Heerdegen
2017-11-20 21:20         ` Emanuel Berg
2017-11-20 21:40           ` John Mastro
2017-11-20 22:19           ` Michael Heerdegen
2017-11-20 20:52       ` Emanuel Berg
2017-11-20 20:12   ` Drew Adams
2017-11-20 20:49     ` Eric Abrahamsen
2017-11-20 21:16       ` Emanuel Berg
2017-11-20 22:02         ` Eric Abrahamsen
2017-11-21  1:54           ` Emanuel Berg
2017-11-21  2:18             ` Emanuel Berg
2017-11-21 17:34               ` Michael Heerdegen
2017-11-21 20:10                 ` Emanuel Berg
2017-11-21 21:33                   ` Michael Heerdegen
2017-11-22 21:30                     ` Nicolas Petton
2017-11-22 21:31                   ` Nicolas Petton
2017-11-21 18:01             ` Philipp Stephani
2017-11-21 18:37               ` Michael Heerdegen
2017-11-21 19:26               ` Drew Adams
2017-11-21 20:17                 ` Emanuel Berg
2017-11-21 20:47                   ` Drew Adams
2017-11-21 20:14               ` Emanuel Berg
     [not found]               ` <mailman.4260.1511289435.27995.help-gnu-emacs@gnu.org>
2017-11-22  3:52                 ` James K. Lowden
2017-11-22  5:04                   ` Michael Heerdegen
2017-11-22 14:06                   ` Emanuel Berg
2017-11-22 14:52                   ` Rusi
2017-11-22 21:28             ` Nicolas Petton
2017-11-23  0:56               ` Emanuel Berg
2017-11-23  1:17                 ` Michael Heerdegen
2017-11-23  1:30                   ` Emanuel Berg
2017-11-25  2:57                 ` John Mastro
2017-11-25  3:54                   ` Robert Thorpe
2017-11-25  4:44                     ` Alexis
2017-11-25  7:10                     ` tomas
2017-11-25 17:11                       ` Emanuel Berg
2017-11-25  7:46                     ` Eli Zaretskii
2017-11-25  8:03                       ` tomas
2017-11-25 19:00                     ` John Mastro
2017-11-25 19:45                       ` Emanuel Berg
2017-11-27  3:44                         ` Michael Heerdegen
2017-11-20 22:59         ` Drew Adams
2017-11-21  1:50           ` Emanuel Berg
     [not found] ` <mailman.4093.1511127491.27995.help-gnu-emacs@gnu.org>
2018-03-06  0:31   ` Robert L.
2018-03-06  8:53     ` Emanuel Berg
2018-03-06  9:29       ` Emanuel Berg
     [not found] <mailman.4086.1511124258.27995.help-gnu-emacs@gnu.org>
2017-11-19 21:19 ` Marco Wahl
2017-11-19 22:51   ` Emanuel Berg
2017-11-21  4:00   ` Emanuel Berg
2017-11-19 21:20 ` Marco Wahl

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).