scala.mobile 应该完成什么任务?
...以及为什么有 包 这个误导性的名称(我以为它与 JavaME 或移动/智能手机有关)?
我在互联网上没有找到任何关于 scala.mobile.Code 或 scala.mobile.Location 的参考资料 根本,我也没有设法做任何事情这些类除了获取 ClassCastExcetion
或 NoSuchMethodError
之外。
实际上,Scala 的测试树中甚至没有针对 scala.mobile 的单个测试可以帮助理解该代码。
这些类确实闻起来像是很久以前就被遗忘在源代码树中,并且从那时起就被意外释放了。
也许我只是错过了一些关于他们的事情?
更新: scala.mobile
在 Scala 2.9 中被删除。
...and why has the package this misleading name (I assumed it had something to do with JavaME or mobile/smart phones)?
I found no references on the internet about scala.mobile.Code
or scala.mobile.Location
at all nor did I manage to do anything with those classes except getting ClassCastExcetion
s or NoSuchMethodError
s.
Actually there is not even a single test against scala.mobile
in the Scala's test tree which could help understanding that code.
The classes really smell like they were forgotten in the source tree a long time ago and got accidentally released since that.
Maybe I just missed something about them?
Update:scala.mobile
was removed in Scala 2.9.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚检查了源代码。
几年前,当 Scala 更改类文件的名称修改时,人们似乎忘记了相应地更新这些类。
所以我的答案是:
至少
Location
有 没有 目的,因为不可能从中得到任何有意义的东西(例外情况除外)和CodeLocation
的 code> 受到严格限制。不过,如果您直接将类文字传递给Code
,它就可以工作:看起来像是反射标准库中的另一个实现,稍微好一些。
I just checked the source code.
When Scala changed the name mangling of class files a few years ago and it seems people forgot to update these classes accordingly.
So my answer would be:
At least
Location
has no purpose, because it is not possible to get anything sensible out of it (except exceptions) andCode
withoutLocation
is severely limited. It works though if you pass the class literal toCode
directly:Looks like yet-another implementation in the standard library of reflection-slightly-nicer.
Location
的描述很好地解释了它的含义:它可能被远程参与者使用。或许。
至于为什么它有这个误导性的名字?嗯,早在 2004 年,智能手机的普及率就很低,所以也许这种关联性并不那么强。
The description of
Location
pretty much explains what that is about:It might be used by remote actors. Maybe.
As for why it has this misleading name? Well, back in 2004 smart phones had really low penetration, so maybe the association wasn't all that strong.