On Mon, 21 Dec 2009 19:16:49 -0800, Carl Worth <cwo...@cworth.org> wrote:
> 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?

Looking back at this proposal now, (after a long delay), I found I
didn't like it at all. With function names like:

        notmuch_threads_to_first
        notmuch_threads_to_next

the missing verb in the name is really distracting. I ended up reading
these names as if they were conversion functions. So I've gone back to
preferring the names with the explicit verbs (even though quite long):

        notmuch_threads_move_to_first
        notmuch_threads_move_to_next

Meanwhile, I also decided that _current wasn't adding anything to the
names it showed up in, (we can never "get" anything other than the
current item, so why qualify as "get_current"?). So I'm changing from
"has_current" to "valid", and leaving "get" as it is.

So the final proposal for iteration in either direction is:

        move_to_first
        valid
        move_to_next

        move_to_last
        valid
        move_to_previous

        get

I've just pushed commits changing the existing functions (which allow
only forward iteration) to use this naming scheme. I haven't added any
of the reverse-iteration functions yet, so Ruben, if you'd like to do
those within this scheme, that would be find. (Or we could wait until we
have an actual use in mind for them.)

Thanks,

-Carl

Attachment: pgpbyAoHMFXfl.pgp
Description: PGP signature

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to