- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
A Template for Scala
Wed, 2009-12-02, 23:39
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.
--
Daniel C. Sobral
I travel to the future all the time.
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.
>