[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: seq-some-p and nil
From: |
Drew Adams |
Subject: |
RE: seq-some-p and nil |
Date: |
Wed, 9 Sep 2015 06:26:42 -0700 (PDT) |
> I meant extra complexity for the user. If seq-some was returning a
> value, I wouldn't expect it to be a cons cell, I'd almost always want
> the element of the sequence straight away.
Well, yes. But what if the user wants the value returned by the
function? And what if the element is nil?
1. You need a way to always return non-nil when an element is found.
This includes the case where the element is nil - you cannot
just return nil as the element.
2. You (I) want to be able to use the the `some' function to
either get the element or get the return value of the predicate,
which can be an arbitrary function that could return a rich value.
Or both: get and use both the element and the value.
Conclusion: return both the element and the predicate value, as
a non-nil Lisp value. (ELEMENT . VALUE) is one such simple value.
- Re: seq-some-p and nil, (continued)
- Re: seq-some-p and nil, Stefan Monnier, 2015/09/07
- Re: seq-some-p and nil, Nicolas Petton, 2015/09/08
- Re: seq-some-p and nil, Stefan Monnier, 2015/09/08
- Re: seq-some-p and nil, Nicolas Petton, 2015/09/08
- 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, Drew Adams, 2015/09/08
- RE: seq-some-p and nil, Nicolas Petton, 2015/09/08
- RE: seq-some-p and nil, Drew Adams, 2015/09/08
- RE: seq-some-p and nil, Nicolas Petton, 2015/09/09
- RE: seq-some-p and nil,
Drew Adams <=
- 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, 2015/09/08