Roundup Tracker - Issues

Message3800

Author schlatterbeck
Recipients ajaksu2, ber, richard, schlatterbeck, tobias-herp
Date 2009-07-15.11:30:46
Message-id <20090715113043.GF24755@runtux.com>
In-reply-to <1247653335.39.0.737242921931.issue1182919@psf.upfronthosting.co.za>
Let me put my proposal here, too:

Proposal
~~~~~~~~

The following examples use either numbers or dates but we're using the
same search-syntax for both.

- search support for roundup Date and Number (Numbers in roundup are floats)
  no support for searching IDs (that would require major surgery in
  roundup)

- the semicolon ";" (or 'to') is the range operator, like in::

    date1;date2

- A more human-readable variant replaces the ';' with 'to' and allows an
  optional 'from' at the start, e.g.::

    from date1 to date2

- ranges can have inclusive or exclusive limits::

    [a; b]          --> a <= x <= b
    [a; b)          --> a <= x <  b
    (a; b)          --> a <  x <  b
    (a; b]          --> a <  x <= b

  (to continue support for existing date searches,
  and important for floats)

  The lower or upper bound can be left out to specify open (up to
  infinity) ranges::

    [a;]
    [;b]

  (and similar for round parentheses)

  A single number is a range including only that number::

    [a]

  which can be simplified (see below) to::

    a

- ranges can be specified without brackets::

    a;b

  or for the single-number case::

    a

- ranges without brackets are by default *inclusive* for the lower bound
  and *exclusive* for the upper bound: ``[a;b)`` to be compatible with the
  current date semantics. See note under "Cons" below.

- ranges can be combined using the 'or' operator::

   [1] or [5;7.25)

  or simpler::

   1 or 5;7.25

  Note that I'm *not* allowing comma and/or space to be written instead
  of the "or". See below.

- for convenience of foreign users (e.g., german), float values can be
  specified using decimal commas as well as decimal points, the
  following are different representations of the number 0::

    0
    0.0
    0,0
    0.
    0,
    .0
    ,0

Cons:
=====

The default range without explicit brackets/parentheses (include lower
bound but exclude upper bound) may be counter-intuitive and we might
want to change this.

Using the comma as a decimal separator is fine for non-english speaking
countries but means we can't use the comma for other purposes (like
replacing the 'or').

We might want to have a shorter notation for the 'or' similar to the
'to' vs. ';' in ranges.

Pros:
=====

A usable query syntax that can express all intended searches which isn't
complicated in the easy-search cases.

The proposed syntax is fully backward-compatible for current
implementation of roundup Number and Date types. No need to invalidate
and/or rewrite stored queries. No need to re-train users.

Compared with the other proposal: No two concepts of sets (of numbers
and of ranges) in fact a number is a range (containing just that number)
in my proposal.

Examples
========

Search for several ranges::

  [1;2) or [5;9)

or simpler::

  1;2 or 5;9

Search for a set of numbers (which are in fact intervals internally)::

  1 or 2 or 3 or 7.25

or combine both::

  1 or 2 or 3 or 7.25 or [8.5;9] or 10;11 or 12

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  Fax:   +43/2243/26465-23
Reichergasse 131                        www:   http://www.runtux.com
A-3411 Weidling                         email: office@runtux.com
osAlliance member                       email: rsc@osalliance.com
History
Date User Action Args
2009-07-15 11:30:47schlatterbecksetrecipients: + schlatterbeck, richard, ber, tobias-herp, ajaksu2
2009-07-15 11:30:47schlatterbecklinkissue1182919 messages
2009-07-15 11:30:46schlatterbeckcreate