unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Ruben Pollan <meskio@sindominio.net>
To: Carl Worth <cworth@cworth.org>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] Added regress option to tags iterator
Date: Tue, 5 Jan 2010 16:33:32 +0100	[thread overview]
Message-ID: <20100105153332.GE9339@blackspot> (raw)
In-Reply-To: <87pr67ofz2.fsf@yoom.home.cworth.org>

[-- Attachment #1: Type: text/plain, Size: 2126 bytes --]

On 19:16, Mon 21 Dec 09, Carl Worth wrote:
> 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?).

Not sure if I understand that. Let's see if I understand well. move_to_first
(or move_to_last) will put the iterator in the first (or last) valid item.
move_to_next (and move_to_previous) will be able to reach an invalid item
outside the list. Is it like that?

In some implementations of iterators (like C++ STD) you can reach invalid items
only in one side of the list, at the end, but not at the beginning. Some people
get use to this idea, but should not be a big deal to do it different.

So you are thinking in a function has_current showing if the current item is
valid. Am I right?

> > 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.

I think that's a good option. The names of the functions are still clear like
that, and the original names are too long.


PS: Sorry for the late reply, Christmas is a busy time.


-- 
Rubén Pollán  | jabber:meskio@jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Ésta es la historia de una sociedad que se hunde
y mientras cae se repite:
hasta ahora todo va bien, hasta ahora todo va bien ...
Pero lo importante no es la caida sino el aterrizaje.
                               el odio

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2010-01-05 15:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-26 20:23 notmuch_threads_back and notmuch_messages_back Ruben Pollan
2009-11-28  3:57 ` Carl Worth
2009-12-06 17:34   ` Ruben Pollan
2009-12-07 17:23     ` Carl Worth
2009-12-08  9:41 ` regress option to messages iterator meskio
2009-12-08  9:41   ` [PATCH 1/2] Convert notmuch_message_list_t in a doubly linked meskio
2009-12-08  9:41     ` [PATCH 2/2] Added regress option to messages iterator meskio
2009-12-08  9:57   ` ruben pollan
2009-12-09 12:45 ` [PATCH] Added regress option to threads iterator Ruben Pollan
2009-12-09 13:10 ` [PATCH] Added regress option to tags iterator Ruben Pollan
2009-12-09 13:24   ` Ruben Pollan
2009-12-09 20:08     ` Carl Worth
2009-12-09 21:21       ` Mark Anderson
2009-12-09 21:37         ` Carl Worth
2009-12-09 22:05         ` Ruben Pollan
2009-12-09 22:01       ` Ruben Pollan
2009-12-22  1:23       ` Carl Worth
2009-12-22  3:16         ` Carl Worth
2010-01-05 15:33           ` Ruben Pollan [this message]
2010-01-05 19:39             ` Carl Worth
2010-01-06  9:08               ` Ruben Pollan
2010-03-09 17:36           ` Carl Worth
2010-03-11 14:28             ` Ruben Pollan
2010-03-20 10:23             ` reverse iterators Ruben Pollan
2010-03-21 20:07               ` Sebastian Spaeth
2010-03-22 10:18                 ` Ruben Pollan
2010-03-21 21:32               ` [PATCH] sending again patches 3 & 4 Ruben Pollan
2010-03-21 21:32               ` [PATCH 1/2] Move the logic of threads iterator out of 'valid' Ruben Pollan
2010-03-21 21:32               ` [PATCH 2/2] Added backwards iterator to threads Ruben Pollan
2010-03-20 10:23             ` [PATCH 1/5] Convert notmuch_message_list_t in a doubly linked Ruben Pollan
2010-03-20 10:23             ` [PATCH 2/5] Added backwards iterator to messages Ruben Pollan
2010-03-20 10:23             ` [PATCH 3/5] Move the logic of threads iterator out of 'valid' Ruben Pollan
2010-03-20 10:23             ` [PATCH 4/5] Added backwards iterator to threads Ruben Pollan
2010-03-20 10:23             ` [PATCH 5/5] Added backwards iterator to tags Ruben Pollan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100105153332.GE9339@blackspot \
    --to=meskio@sindominio.net \
    --cc=cworth@cworth.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).