This page is no longer maintained — Please continue to the home page at www.scala-lang.org

RE: GenericRange and @experimental

4 replies
Chris Marshall
Joined: 2009-06-17,
User offline. Last seen 44 weeks 3 days ago.
<20455.1257369844@monk.ccl.northwestern.edu> MIME-Version: 1.0 --_b4867dae-0906-4668-9662-70dfe74f9860_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > Do you guys mean this in a "it's good=2C but someday wouldn't it be great > if it were even more awesome" way? Or in a "it sucks let's axe it from > 2.8" way?=20 I mean that I think it is a shame that you can't have a range of anything w= hich is ordered. Having said that=2C as Daniel has commented=2C it seems as= though Range implies discreteness in Scala-land. Hence I'm not against thi= s going into 2.8. Perhaps a separate Interval class could be written which represents arbitra= ry intervals on ordered sets (which may be bounded=2C closed=2C clopen=2C o= pen etc). Evidently this is not going to make it into 2.8 - had I been on t= his mailing list before Sunday=2C I might have suggested it earlier > (not that we shouldn't discuss potential future improvements=2C perhaps o= n > scala-debate or something=2C but at the moment=2C I suggest we keep this > thread focused on what's of immediate relevance to the 2.8 release) Accepted. I've only been using Scala for a year and am using it in a commer= cial environment=2C which means that I've left the library-cleverness to th= e experts up to now :-) =20 _________________________________________________________________ New Windows 7: Find the right PC for you. Learn more. http://www.microsoft.com/uk/windows/buy/= --_b4867dae-0906-4668-9662-70dfe74f9860_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable &gt=3B Do you guys mean this in a "it's good=2C but someday wouldn't it be = great
&gt=3B if it were even more awesome" way? Or in a "it sucks let's= axe it from
&gt=3B 2.8" way?&nbsp=3B
I mean that I t= hink it is a shame that you can't have a range of anything which is ordered= . Having said that=2C as Daniel has commented=2C it seems as though Range i= mplies discreteness in Scala-land. Hence I'm not against this going into 2.= 8.
Perhaps a separate Interval class could be writ= ten which represents arbitrary intervals on ordered sets (which may be boun= ded=2C closed=2C clopen=2C open etc). Evidently this is not going to make i= t into 2.8 - had I been on this mailing list before Sunday=2C I might have = suggested it earlier
&gt=3B (not that we shouldn't= discuss potential future improvements=2C perhaps on
&gt=3B scala-debate= or something=2C but at the moment=2C I suggest we keep this
&gt=3B thre= ad focused on what's of immediate relevance to the 2.8 release)

Accepted. I've only been using Scala for a year and am using it in a= commercial environment=2C which means that I've left the library-clevernes= s to the experts up to now :-)
New Windows 7: = Find the right PC for you. Learn more. = --_b4867dae-0906-4668-9662-70dfe74f9860_--
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: GenericRange and @experimental
Anyway, by all that I mean we should take GenericRange off Scala 2.8, until something really generic can be put in place.

On Wed, Nov 4, 2009 at 7:52 PM, Daniel Sobral <dcsobral@gmail.com> wrote:
I mean this in a "we cannot extend it to cover other use cases". Which I'm pretty sure was what the other guy meant.   For instance, let's say I want a range from today to the end of the month, by 1 day. If such thing is common in my application, then I may well create the necessary implicit to support it.   However, the implicit required by GenericRange is Integral, which extends Numeric. Does "abs" make any sense for dates? Or most of the other abstract Numeric methods? No. And they may make even less sense for other stuff.   And let's look at the methods inside GenericRange itself. Can we do "multiply the entire range by some constant"?   So, back to what would be really generic. I need to be able to tell the boundaries of the range, I need to find out if something is inside or outside the range, and I need to be able to step through it. Given a step unit, I need to be able to add it to a boundary and get a new boundary back. Ideally, the boundary types and the step type would not, necessarily, be the same.   This would account for all methods inside GenericRange except "*". To me, that is a small loss for a greater gain. But, of course, it would require something other than "Integral" as implicit. Something simple and to the point.

On Wed, Nov 4, 2009 at 7:24 PM, Seth Tisue <seth@tisue.net> wrote:
>>>>> "Daniel" == Daniel Sobral <dcsobral@gmail.com> writes:

 Daniel> I'm with whoever brought up that this GenericRange isn't
 Daniel> Generic enough.

Do you guys mean this in a "it's good, but someday wouldn't it be great
if it were even more awesome" way?  Or in a "it sucks let's axe it from
2.8" way?  The 2.8 train is in the process of leaving the station, so at
the moment it's too late to wish for awesomeness that isn't even
designed or implemented yet.  I'd hate to lose the ability to say "1L to
10L" in 2.8 just because of some theoretical future possibility of being
able to say other things too.

(not that we shouldn't discuss potential future improvements, perhaps on
scala-debate or something, but at the moment, I suggest we keep this
thread focused on what's of immediate relevance to the 2.8 release)

--
Seth Tisue @ Northwestern University / http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/



--
Daniel C. Sobral

Veni, vidi, veterni.



--
Daniel C. Sobral

Veni, vidi, veterni.
Seth Tisue
Joined: 2008-12-16,
User offline. Last seen 34 weeks 3 days ago.
Re: GenericRange and @experimental

>>>>> "Daniel" == Daniel Sobral writes:

Daniel> Anyway, by all that I mean we should take GenericRange off
Daniel> Scala 2.8, until something really generic can be put in place.

What if it were renamed to NumericRange?

Chris Marshall
Joined: 2009-06-17,
User offline. Last seen 44 weeks 3 days ago.
RE: GenericRange and @experimental
<9461d7d00911041331rab6bc76xdc5c037ca663ea65@mail.gmail.com> MIME-Version: 1.0 --_f7910c14-0a56-42bc-b368-ec6ca42778b3_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > I have no sring opinions on GenericRange. But it's indicative of a > larger problem. Do you do the quick thing now=2C with the risk of making > the more general thing later impossible without breakage=2C or do you > wait until you have something more general?=20 The solution to this is to put as little functionality in as possible. A si= ngle class is relatively straightforward and uncomplicated - although your = argument is perfectly valid for larger projects (like Generic Java for exam= ple) which *must* be got right first time. When we are talking about individual classes=2C how will the adding of thes= e to the incubator and decision process be organized? This could turn into = a real mess very quickly (i.e. the JCP) =20 _________________________________________________________________ New Windows 7: Find the right PC for you. Learn more. http://www.microsoft.com/uk/windows/buy/= --_f7910c14-0a56-42bc-b368-ec6ca42778b3_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
&gt=3B I have no sring opinions on GenericRange. But it's indicative of= a
&gt=3B larger problem. Do you do the quick thing now=2C with the risk= of making
&gt=3B the more general thing later impossible without breaka= ge=2C or do you
&gt=3B wait until you have something more general?&nbsp= =3B

The solution to this is to put as little functio= nality in as possible. A single class is relatively straightforward and unc= omplicated - although your argument is perfectly valid for larger projects = (like Generic Java for example) which *must* be got right first time.=
When we are talking about individual classes=2C how wil= l the adding of these to the incubator and decision process be organized? T= his could turn into a real mess very quickly (i.e. the JCP) =
New Windows 7: Find the right PC for you. Learn more. = --_f7910c14-0a56-42bc-b368-ec6ca42778b3_--
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: GenericRange and @experimental
I would have no problem with that. It makes a lot of sense, in fact.

On Wed, Nov 4, 2009 at 8:02 PM, Seth Tisue <seth@tisue.net> wrote:
>>>>> "Daniel" == Daniel Sobral <dcsobral@gmail.com> writes:

 Daniel> Anyway, by all that I mean we should take GenericRange off
 Daniel> Scala 2.8, until something really generic can be put in place.

What if it were renamed to NumericRange?

--
Seth Tisue @ Northwestern University / http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/



--
Daniel C. Sobral

Veni, vidi, veterni.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland