Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C69E5431FAF for ; Mon, 17 Sep 2012 08:35:54 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UQwwJEmq8oQX for ; Mon, 17 Sep 2012 08:35:54 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id EC6D3431FAE for ; Mon, 17 Sep 2012 08:35:53 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 191CF10014F; Mon, 17 Sep 2012 18:35:59 +0300 (EEST) From: Tomi Ollila To: Michal Nazarewicz , David Bremner , Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH v3 6/9] lib: add date range query support In-Reply-To: References: <532340d05ea748518c021048900bb83149e04e88.1347484177.git.jani@nikula.org> <878vce5cip.fsf@zancas.localnet> User-Agent: Notmuch/0.13.2+171~g2d1a988 (http://notmuchmail.org) Emacs/24.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2012 15:35:55 -0000 On Mon, Sep 17 2012, Michal Nazarewicz wrote: >> Michal Nazarewicz writes: >>> IMO this is totally unintuitive and not how the range should work. >>> date:foo..bar should return messages whose date >=3D foo and < bar. So >>> for instance date:november..yesterday should return messages whose date >>> is > 2012/11/01 00:00:00 and < 2012/09/12 00:00:00. So to get >>> yesterdays messages one would do: date:yesterday..today. > > On Thu, Sep 13 2012, David Bremner wrote: >> I don't find ranges being half-open by default to be very >> intuitive. Perhaps I don't program in python enough. > > Perhaps C than: =E2=80=9Cfor (i =3D 0; i < 10; ++i)=E2=80=9D is the stand= ard idiom and the > end range is open. > > Let's take a look at: > > date:2012/01/01..2012/01/01 + 1 day > > in my opinion, that should give results from the first of January only, > since =E2=80=9C+ 1 day=E2=80=9D indicates in a way how long user want the= period to be. > > I think it's also easier to pragmatically create ranges. For instance, > let's say you want to create ranges for each week, you'd end up with: > > date:2012/01/02..2012/01/09 ## 2012w01 > date:2012/01/09..2012/01/16 ## 2012w02 > date:2012/01/16..2012/01/23 ## 2012w03 Ok, these matches with ISO Week... > Notice how the opening date of a range matches the closing date of > the previous date. 2012/01/02 is monday 2012/01/09 is monday. For me=20 date:2012/01/02..2012/01/08 ## 2012w01 would be more intuitive in this context. for (i =3D 0; i < 10; ++i) loops through 0 - 9. for (i =3D 1; i <=3D 10; ++i) loops through 1 - 10. python -c 'for f in range(5): print f' prints 0 - 4 perl -le 'for (1..5) { print $_ }' prints 1 - 5 ... these does not clarify, but confuses these intuitions :D > > --=20 > Best regards, _ _ > ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz = (o o) Tomi