Roundup Tracker - Issues

Message3671

Author tobias-herp
Recipients ajaksu2, richard, schlatterbeck, tobias-herp
Date 2009-04-01.15:01:02
Message-id <1238598063.72.0.772849065829.issue1182919@psf.upfronthosting.co.za>
In-reply-to
I didn't know what is apparently the ISO notation
(<http://en.wikipedia.org/wiki/Interval_(mathematics)>); I was familiar
with the "set builder notation":

[1,200] would find 1<=x<=200
(1,200) would find 1<x<200
[1,200) would find 1<=x<200

The "]a,b[" example looked contra-intuitive to me; some could read it as
"<= a or >= b".  Thus, the mathematical notation might not be the best
solution;  it doesn't conform with the Python notation anyway:

  range(1,200)
or
  [1:200]  # Python

is like
  [1,200[  # ISO
  [1,200)  # set builder
or
  [1,199]  # both ISO and set builder

What about accepting input like this:

1 <= x <= 200   # Python; accept any identifier
>=1 and <=200   # pythonic/english "and"
>=1 && <=200    # C, Bash, DOS-Shell

1 < x < 200     # Python; accept any identifier
>1 and <200     # pythonic "and"
>1 && <200      # C, Bash, DOS-Shell

1 <= x < 200    # Python; accept any identifier
>=1 and <200    # pythonic "and"
>=1 && <200     # C, Bash, DOS-Shell
 
We could create a callable object when parsing a non-empty expression. 
The concept could be extended to evaluate parentheses and even field
names (for a one-entryfield search function).  The comma could be
interpreted as "and".

We could generate boolean functions (accepting a single number) or,
perhaps better, SQL code (for the WHERE clause).

The expression syntax would be a superset of Daniel's solution :-)
History
Date User Action Args
2009-04-01 15:01:03tobias-herpsetmessageid: <1238598063.72.0.772849065829.issue1182919@psf.upfronthosting.co.za>
2009-04-01 15:01:03tobias-herpsetrecipients: + tobias-herp, richard, schlatterbeck, ajaksu2
2009-04-01 15:01:03tobias-herplinkissue1182919 messages
2009-04-01 15:01:02tobias-herpcreate