[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: seq-some-p and nil
From: |
Stefan Monnier |
Subject: |
Re: seq-some-p and nil |
Date: |
Tue, 08 Sep 2015 16:33:07 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
>>>> then in most cases, I think the code ends up just as simple with
>>>> seq-some as with seq-find.
>> [...]
>>> To make things easier to understand, I'm taking the example of finding
>>> the first odd number in a seq:
>> I've never needed to do that.
> That was just an example. You never needed to find an element from
> a sequence?
On its own, no; only to do something with it. So I think in many cases
you can cheaply move the equivalent of (and <pred> x) into the seq-some
search, in many other cases you can instead cheaply move the processing
of the result into the seq-some search.
Of course, there are still remaining cases where you'll end up needing
(lambda (x) (if (my-pred x) x)), but in my experience, it's not frequent
enough to make a seq-find useful.
This said, we have lots of such functions I find useless, so don't let
that prevent you from adding it to seq.el. Just don't forget to warn
about its little semantic problem with nil in the docstring.
Stefan
- RE: seq-some-p and nil, (continued)
- RE: seq-some-p and nil, Drew Adams, 2015/09/09
- Re: seq-some-p and nil, Stefan Monnier, 2015/09/09
- RE: seq-some-p and nil, Drew Adams, 2015/09/09
- Re: seq-some-p and nil, Stefan Monnier, 2015/09/09
- RE: seq-some-p and nil, Drew Adams, 2015/09/09
- RE: seq-some-p and nil, Nicolas Petton, 2015/09/09
- Re: seq-some-p and nil, Stefan Monnier, 2015/09/08
- Re: seq-some-p and nil, David Kastrup, 2015/09/08
- Re: seq-some-p and nil, Nicolas Petton, 2015/09/08
- Re: seq-some-p and nil, David Kastrup, 2015/09/08
- Re: seq-some-p and nil,
Stefan Monnier <=
- Re: seq-some-p and nil, Nicolas Petton, 2015/09/09
- Re: seq-some-p and nil, Nicolas Petton, 2015/09/08
- Re: seq-some-p and nil, Mark Oteiza, 2015/09/08
- Re: seq-some-p and nil, Stefan Monnier, 2015/09/08
- Re: seq-some-p and nil, Mark Oteiza, 2015/09/08
- Re: seq-some-p and nil, Stephen J. Turnbull, 2015/09/09
- Re: seq-some-p and nil, Mark Oteiza, 2015/09/09
- Re: seq-some-p and nil, Nicolas Petton, 2015/09/07
Re: seq-some-p and nil, Nicolas Petton, 2015/09/03