[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: seq-some-p and nil

From: Nicolas Petton
Subject: RE: seq-some-p and nil
Date: Wed, 09 Sep 2015 09:56:41 +0200
User-agent: Notmuch/0.19 (http://notmuchmail.org) Emacs/ (x86_64-unknown-linux-gnu)

Drew Adams <address@hidden> writes:

>> > Was there something wrong with the suggestion to return,
>> > as the non-nil value, a cons (ELEMENT . VALUE)?
>> >
>> > (Where ELEMENT is the sequence element that satisfies the
>> > predicate, and VALUE is the return value of the predicate
>> > for that element.)
>> >
>> > That gives you "some" element that satisfies the predicate
>> > (the first such).  And it gives you the result of the test.
>> > Each of these can be useful, depending on the context.
>> It would work, and I believe Scheme has a similar function, but I don't
>> want seq-some to have this extra complexity.  It could be another
>> function though, just like in Scheme.
> What extra complexity?  It creates one cons cell which has as its
> car and cdr things that presumably already exist.

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.

Nicolas Petton

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]