1 Return-Path: <cworth@cworth.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 2827B431FBD;
\r
6 Mon, 21 Dec 2009 17:23:57 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id 5QzIpCwZrpXB; Mon, 21 Dec 2009 17:23:56 -0800 (PST)
\r
11 Received: from yoom.home.cworth.org (localhost [127.0.0.1])
\r
12 by olra.theworths.org (Postfix) with ESMTP id 3906F431FAE;
\r
13 Mon, 21 Dec 2009 17:23:56 -0800 (PST)
\r
14 Received: by yoom.home.cworth.org (Postfix, from userid 1000)
\r
15 id E959F254306; Mon, 21 Dec 2009 17:23:55 -0800 (PST)
\r
16 From: Carl Worth <cworth@cworth.org>
\r
17 To: Ruben Pollan <meskio@sindominio.net>, notmuch@notmuchmail.org
\r
18 In-Reply-To: <877hsv6hbo.fsf@yoom.home.cworth.org>
\r
19 References: <20091126202347.GA16654@blackspot>
\r
20 <1260364206-344-1-git-send-email-meskio@sindominio.net>
\r
21 <20091209132446.GC23878@blackspot>
\r
22 <877hsv6hbo.fsf@yoom.home.cworth.org>
\r
23 Date: Mon, 21 Dec 2009 17:23:55 -0800
\r
24 Message-ID: <87r5qnol78.fsf@yoom.home.cworth.org>
\r
26 Content-Type: multipart/signed; boundary="=-=-=";
\r
27 micalg=pgp-sha1; protocol="application/pgp-signature"
\r
28 Subject: Re: [notmuch] [PATCH] Added regress option to tags iterator
\r
29 X-BeenThere: notmuch@notmuchmail.org
\r
30 X-Mailman-Version: 2.1.12
\r
32 List-Id: "Use and development of the notmuch mail system."
\r
33 <notmuch.notmuchmail.org>
\r
34 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
35 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
36 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
37 List-Post: <mailto:notmuch@notmuchmail.org>
\r
38 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
39 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
40 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
41 X-List-Received-Date: Tue, 22 Dec 2009 01:23:57 -0000
\r
45 On Wed, 09 Dec 2009 12:08:43 -0800, Carl Worth <cworth@cworth.org> wrote:
\r
46 > On Wed, 9 Dec 2009 14:24:46 +0100, Ruben Pollan <meskio@sindominio.net> wrote:
\r
47 > > Do you like to call them regress? Should I change that?
\r
49 > > What about the functions notmuch_*_is_first? Is kind of reversed logic than
\r
50 > > notmuch_*_has_more, the last are true when is not reach the limit but the
\r
51 > > first ones are true when the limit is reached. But I think it make sense like
\r
54 It doesn't make sense in the case of trying to write a for loop that
\r
55 iterates in the reverse order. The is_first semantic doesn't give you
\r
56 what you want for the loop-control portion of the for loop.
\r
58 > I'd like a more symmetric API here. Anyone have a favorite set of names
\r
59 > for iterating a list in two directions?
\r
61 In some recent coding I needed to implement a new iterator so I had the
\r
62 chance to think about this some more. Here is what I came up with:
\r
64 New function Corresponds to existing function (if any)
\r
65 ------------ -----------------------------------------
\r
66 move_to_first <implicit in iterator creation>
\r
68 move_to_next advance
\r
72 move_to_previous <none>
\r
76 The semantics of those all seem clear enough to me. They provide what's
\r
77 necessary for all three portions of a for loop, (in either direction),
\r
78 and everything pairs nicely.
\r
80 The only downside is that the function names are a bit long in some
\r
81 cases, but I'm willing to live with that until someone comes up with
\r
90 Content-Type: application/pgp-signature
\r
92 -----BEGIN PGP SIGNATURE-----
\r
93 Version: GnuPG v1.4.10 (GNU/Linux)
\r
95 iD8DBQFLMB+r6JDdNq8qSWgRArSAAJ49Ja9kHikoorvY/kXPqvAgbTNCCQCggdyz
\r
96 vrtsxqN6BecsttfhBstYQwc=
\r
98 -----END PGP SIGNATURE-----
\r