Update to Scala 2.8 in progress

Discuss issues specific the Scala port of Box2D
Villane
Posts: 101
Joined: Mon Sep 01, 2008 6:32 am

Update to Scala 2.8 in progress

Postby Villane » Sat Feb 20, 2010 10:01 am

I started updating ScalaBox2D to Scala 2.8, and 2.7.x support will unfortunately be dropped, simply because they are not compatible and I don't have time to maintain two different branches. Scala 2.8 is stable enough for production use (since Beta1 at least) and it makes sense to me to move to that version.

I haven't completely decided which new Scala 2.8 features to use, but package objects and named/default parameters are some of those.

Package objects lets you get away with less import statements, as implicit conversions, type aliases and other things can be defined at the package level. So now you won't have to explicitly import the org.villane.vecmath package, because org.villane.box2d defines type aliases for Vector2, Matrix22 etc., and all the implicit conversions needed.

Named/default parameters can largely replace the internal DSL I built for defining fixtures and bodies, as most of that was pretty much dealing with the lack of named/default parameters. The DSL syntax may become a tiny bit more verbose as a result, but I think it's worth it and may even make it easier to understand. Also, I can now make the definition classes immutable.

Return to “Scala”



Who is online

Users browsing this forum: No registered users and 1 guest