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

scala.mobile or "why does Scala ship broken classes"?

1 reply
soc
Joined: 2010-02-07,
User offline. Last seen 34 weeks 5 days ago.

How is it possible that Scala's standard library shipped (and ships)
with a class which actually stopped working somewhere between 2004 and
2011?

A good answer might be one of these:

- We don't have a _single_ test case for those class.
- We don't use it anywhere in the standard library.
- No one else actually uses it.
- Nobody reads library code.

Really ... when did Scala change the name mangling of class files?
This must have been well before my time, at least before middle 2009.

It seems that no one ever looked at scala.mobile.Location after that
change and saw that the class needs fixing, because

> // source 'class A { ... }' becomes in bytecode: interface A.class +
> class A$class.class
> // source 'object A { ... }' becomes in bytecode: interface A.class
> + class A$.class
> val append = if (loader.loadClass(className).isInterface) "$class" else "$"

is just wrong.

Shoudn't alarm bells be ringing if something starts to do nothing but
throwing exceptions?

I could start raging about the name "mobile" as well (how is that
supposed to be related with reflection?) ... but really, how many
ad-hoc "make-reflection-slightly-nicer" implementations do we need in
parallel in the standard library?

We have at least another one in scala.testing.Show and scala.util
...well, "Here be dragons".

Thanks for your patience (I feel much better now) and bye,

Simon

extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: scala.mobile or "why does Scala ship broken classes"?

On 4/22/11 4:47 PM, Simon Ochsenreither wrote:
> How is it possible that Scala's standard library shipped (and ships)
> with a class which actually stopped working somewhere between 2004 and
> 2011?
>
> A good answer might be one of these:
>
> - We don't have a _single_ test case for those class.
> - We don't use it anywhere in the standard library.
> - No one else actually uses it.
> - Nobody reads library code.

One of those might be a good answer? Then we're in good shape because I
would be surprised if 3/4 of those didn't apply in full. The fourth
might apply as well if we're speaking of this particular library code
and not library code in general.

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