[ioke-dev] Time and date ranges

  • From: Ola Bini <ola.bini@gmail.com>
  • To: ioke-language@googlegroups.com, dev@ioke.kenai.com, user@ioke.kenai.com
  • Subject: [ioke-dev] Time and date ranges
  • Date: Fri, 27 Nov 2009 10:04:58 +0100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=DZnH3j6aW+b9V3c9qiq4ZWcONhi0G1jG7zDiEKxZBuPnhDC1vLCVpLbfkpiRkL/YES A1OuN1YzCBu5yLOBVsyr8933ey59yeh9/u1XFuaprWRI8fL3qlSF9Pv+VwKLXYBeBWSB 1LoJ25Nr7e8BtvDCWsklAtKVVK+9YIlZJRDeo=

Should the range operator do different things for different kinds of objects?

My first reaction is NO!!!!, but then I started thinking about ranges of dates and times. Since we are using Joda under the covers, it might make sense for DateTime .. to return a Joda Interval under the covers.

Would people be surprised if .. didn't return a Range? Or should we create an object DateTime Interval that mimics Range? What do people think about this?

And if .. returns a DateTime Interval in this case, might it be interesting to have it return other things for other kinds of objects? One thing I immediately see as interesting is Text.

If this:

  "foo".."fox"

Returns a Text Range - then maybe the Text Range object could mimic both Range and Regexp? It kinda makes sense to be able to handle a range of Text as if it were a regexp.

Any other interesting ideas here?

Also the whole DateTime API would really need to TLC. It would be lovely to have all the things you expect from a good DateTime API in there. Anyone feel up to that challenge?

Cheers
--
 Ola Bini (http://olabini.com)
  Ioke - JRuby - ThoughtWorks

 "Yields falsehood when quined" yields falsehood when quined.



[ioke-dev] Time and date ranges

Ola Bini 11/27/2009
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close