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

A Template for Scala

1 reply
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
I admit I have little experience with the IDEs out there, and none whatsoever with whatever templates they offer. However, there is one template I think would be very interesting, which is something without equivalent in the Java world. I beg the IDE developers out there to consider it.   The idea is the "case class-like" template. I'm thinking of a situation where I need to override a tiny part of a case class -- either from the start or during a refactoring -- in which case I have to rewrite the whole case class as a normal class. So, it would be nice to have a template which generated the code normally associated with a case class: val parameters in the constructor, hashCode, equals, toString, copy, object companion with apply and unapply methods. And anything else I might have forgotten.

--
Daniel C. Sobral

I travel to the future all the time.
Dave Griffith
Joined: 2009-01-14,
User offline. Last seen 42 years 45 weeks ago.
Re: A Template for Scala

I've got "Replace case class with standard class" on the roadmap for
ScalaPowerPack, but as you note
it's a big problem (even leaving off serialization as you did). Don't
expect anything too soon.

--Dave Griffith

Daniel Sobral wrote:
>
> I admit I have little experience with the IDEs out there, and none
> whatsoever with whatever templates they offer. However, there is one
> template I think would be very interesting, which is something without
> equivalent in the Java world. I beg the IDE developers out there to
> consider
> it.
>
> The idea is the "case class-like" template. I'm thinking of a situation
> where I need to override a tiny part of a case class -- either from the
> start or during a refactoring -- in which case I have to rewrite the whole
> case class as a normal class. So, it would be nice to have a template
> which
> generated the code normally associated with a case class: val parameters
> in
> the constructor, hashCode, equals, toString, copy, object companion with
> apply and unapply methods. And anything else I might have forgotten.
>

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