Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 5a / a743465f46ad196eb56372b244894c571b6cf4
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
25 MIME-Version: 1.0\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
31 Precedence: list\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
42 \r
43 --=-=-=\r
44 \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
48 ...\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
52 > > that.\r
53 \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
57 \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
60 \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
63 \r
64   New function          Corresponds to existing function (if any)\r
65   ------------          -----------------------------------------\r
66   move_to_first         <implicit in iterator creation>\r
67   has_next              has_more\r
68   move_to_next          advance\r
69 \r
70   move_to_last          <none>\r
71   has_previous          <none>\r
72   move_to_previous      <none>\r
73 \r
74   get                   get\r
75 \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
79 \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
82 better.\r
83 \r
84 Thoughts?\r
85 \r
86 -Carl\r
87 \r
88 \r
89 --=-=-=\r
90 Content-Type: application/pgp-signature\r
91 \r
92 -----BEGIN PGP SIGNATURE-----\r
93 Version: GnuPG v1.4.10 (GNU/Linux)\r
94 \r
95 iD8DBQFLMB+r6JDdNq8qSWgRArSAAJ49Ja9kHikoorvY/kXPqvAgbTNCCQCggdyz\r
96 vrtsxqN6BecsttfhBstYQwc=\r
97 =RxAS\r
98 -----END PGP SIGNATURE-----\r
99 --=-=-=--\r