Re: [notmuch] [PATCH] Added regress option to tags iterator

Subject: Re: [notmuch] [PATCH] Added regress option to tags iterator

Date: Mon, 21 Dec 2009 19:16:49 -0800

To: Ruben Pollan, notmuch@notmuchmail.org

Cc:

From: Carl Worth


On Mon, 21 Dec 2009 17:23:55 -0800, Carl Worth <cworth@cworth.org> wrote:
>   New function		Corresponds to existing function (if any)
>   ------------		-----------------------------------------
>   move_to_first		<implicit in iterator creation>
>   has_next		has_more
>   move_to_next		advance
> 
>   move_to_last		<none>
>   has_previous		<none>
>   move_to_previous	<none>
> 
>   get			get
> 
> The semantics of those all seem clear enough to me. They provide what's
> necessary for all three portions of a for loop, (in either direction),

Except that they don't. :-P

We don't want has_next and has_previous but something more like "has
current", (perhaps to pair with get_current?).

> The only downside is that the function names are a bit long in some
> cases, but I'm willing to live with that until someone comes up with
> better.

One option is to just drop the "move_ " prefix. Then everything will be
a two-word function. So the new proposal is:

to_first
has_current
to_next

to_last
has_current
to_previous

get_current

Better?

-Carl
part-000.sig (application/pgp-signature)

Thread: